<div> </div>
<div>Hi Andreas,</div>
<div> </div>
<div>I tried icpc and icc. When compiling COIN without -cxxlib-gcc, the following error comes out during the compilation:</div>
<div> </div>
<div>
<p>CglProbing.cpp(41): error: name must be a namespace name<br> using namespace __gnu_cxx;<br> ^</p>
<p>CglProbing.cpp(128): error: hash_set is not a template<br> hash_set<OsiRowCut2 , row_cut_hash, row_cut_compare> rowCut_;<br> ^</p>
<p>CglProbing.cpp(147): error: identifier "hash_set" is undefined<br> hash_set<OsiRowCut2 , row_cut_hash, <br> ^</p>
<p>CglProbing.cpp(147): error: type name is not allowed<br> hash_set<OsiRowCut2 , row_cut_hash, <br> ^</p>
<p>CglProbing.cpp(147): error: type name is not allowed<br> hash_set<OsiRowCut2 , row_cut_hash, <br> ^</p>
<p>CglProbing.cpp(148): error: type name is not allowed<br> row_cut_compare>::iterator find;<br> ^</p>
<p>CglProbing.cpp(148): error: the global scope has no "iterator"<br> row_cut_compare>::iterator find;<br> ^</p>
<p>......</p>
<p>If i compile it with CXXFLAGS="-cxxlib-gcc", the COIN libraries can be successfully compiled and installed. However, when i try to link my own MPI program with COIN, without -cxxlib-gcc as a link option, the following error comes up:
</p>
<p>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::__default_alloc_template<true, 0>::allocate(unsigned)'<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
<br>/home/osu4502/Coin-Cbc/lib/libCoinUtils.so: undefined reference to `std::ostream::operator<<(bool)'<br>/home/osu4502/Coin-Cbc/lib/libOsiClp.so: undefined reference to `std::string::operator=(char const*)'
<br>/home/osu4502/Coin-Cbc/lib/libOsiClp.so: undefined reference to `std::string::compare(char const*) const'<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::string::string(std::string const&)'
<br>/home/osu4502/Coin-Cbc/lib/libClp.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char)'
<br>/home/osu4502/Coin-Cbc/lib/libOsiClp.so: undefined reference to `std::string::operator=(std::string const&)'<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::allocator<char>::allocator()'
<br>/home/osu4502/Coin-Cbc/lib/libOsiCbc.so: undefined reference to `std::string::size() const'<br>/home/osu4502/Coin-Cbc/lib/libCgl.so: undefined reference to `std::string::append(char const*)'<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
<br>/home/osu4502/Coin-Cbc/lib/libCgl.so: undefined reference to `std::__throw_length_error(char const*)'<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::ostream::operator<<(void const*)'
<br>/home/osu4502/Coin-Cbc/lib/libOsiCbc.so: undefined reference to `std::string::reserve(unsigned)'<br>......</p>
<p>After adding -cxxlib-gcc as a link option, my program compiles and links to COIN successfully. but when i run the executable, again without printing out the first line of main function, it directly gives me a seg fault.
</p>
<p>Could you please help me to solve this problem?</p>
<p>Many thanks -- yang</p>
<p><br> </p></div>
<div><span class="gmail_quote">On 6/20/07, <b class="gmail_sendername">Andreas Waechter</b> <<a href="mailto:andreasw@watson.ibm.com">andreasw@watson.ibm.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Yang,<br><br>The first thing I would suggest is to use the same compiler for your<br>application and the COIN libraries. You can specify the compiler you want
<br>to use with the CC, CXX, anf F77 (if you have Fortran code) arguments for<br>configure, see<br><br><a href="https://projects.coin-or.org/CoinHelp/wiki/user-configure#VariableArgumentsforconfigure">https://projects.coin-or.org/CoinHelp/wiki/user-configure#VariableArgumentsforconfigure
</a><br><br>You probably also want to use the same compiler flags (CFLAGS and CXXFLAGS<br>as in your application. The COIN configure scripts determine a default<br>value for those, based on the compiler name, and we have also default
<br>values for the Intel compilers (maybe you like them already as they<br>are...).<br><br>I hope this helps,<br><br>Andreas<br><br>On Wed, 20 Jun 2007, YANG YUAN wrote:<br><br>> Hi,<br>><br>> I am working on a MPI application using COIN-cbc, clp as solvers. The COIN
<br>> shared libraries have been made using gcc, however, my own MPI program<br>> together with COIN failed to compile using mpicc (a compiler and linker<br>> constructed for MPI application). Instead, i use the intel C++ compiler
<br>> "icpc" together with some necessary MPI lib and include files.<br>> Fortunately, the compilation and linking are fine, but on the other hand,<br>> probably it is one of the reason that causes the following errors.
<br>><br>> If I add the link flags -cxxlib-gcc or -shared while linking my program with<br>> COIN shared libraries. the executable can be successfully generated.<br>> However, everytime i run it, it directly gives me a seg fault even without
<br>> getting into the main function. it is proved by no output of the first<br>> "printf", as shown below.<br>><br>> #include ***<br>><br>> int<br>> main (int argc, char *argv[])<br>> {<br>
> printf ("Beginning of the code.\n");<br>> ......<br>> }<br>><br>><br>><br>> If I get rid of the link flags -cxxlib-gcc or -shared, the above seg fault<br>> is gone. and the Coin utility functions seem to work fine, but it fails to
<br>> solve a simple MIP problem with output "Cbc: LP relaxation is infeasible or<br>> too expensive". I write the MIP out, actually the problem is ok and it can<br>> be solved very easily.<br>><br>> I am suspecting that there might exist some linking errors, so that although
<br>> the libraries (-lCbc -lCgl -lOsiClp -lOsiCbc -lOsi -lClp -lCoinUtils) have<br>> been linked, they don't function well. I sense the usage of shared libraries<br>> might also be a problem, but so far i have no luck in finding what's wrong.
<br>> If you have any idea or some experience with using MPI and COIN together,<br>> please kindly provide me some directions. Any suggestion is extremely<br>> appreciated!<br>><br>> Thanks!<br>><br>> yang
<br>><br>> p.s. The following is the makefile i am using:<br>><br>> /******************************************<br>><br>> D2BAC=$(HOME)/D2-MPI<br>><br>> CXX = icpc<br>><br>> # C++ Compiler options
<br>> CXXFLAGS = -O2 -unroll0 -mp1 -w -ip<br>> # -cxxlib-gcc -gcc-version=323<br>><br>> # additional C++ Compiler options for linking<br>> CXXLINKFLAGS =<br>> #-Wl,--rpath -Wl,/home/osu4502/Coin-Cbc/lib -cxxlib-gcc
<br>><br>> # Directory with COIN header files<br>> COININCDIR = $(HOME)/Coin-Cbc-T1/include<br>><br>> # Directory with COIN libraries<br>> COINLIBDIR = $(HOME)/Coin-Cbc-T1/lib<br>><br>> # Directory with C library and header files
<br>> CINCDIR = /usr/local/intel-8.0-20040716/include/c++<br>> CLIBDIR = /usr/local/intel-8.0-20040716/lib<br>><br>> # Libraries necessary to link with Clp<br>> LIBS = -L$(COINLIBDIR) -lCbc -lCgl -lOsiClp -lOsiCbc -lOsi -lClp -lCoinUtils
<br>> \<br>> -lm -lc \<br>> `cat $(COINLIBDIR)/cgl_addlibs.txt` \<br>> `cat $(COINLIBDIR)/osi_addlibs.txt` \<br>> `cat $(COINLIBDIR)/clp_addlibs.txt` \<br>> `cat $(COINLIBDIR)/coinutils_addlibs.txt`
<br>><br>> # ------------------------------------------------------------<br>><br>> clean :<br>> /bin/rm -rf *.o *~<br>><br>> realclean :<br>> /bin/rm -rf *.o *~<br>> /bin/rm -rf *.mps *.ord *.sos *.lp *.sav *.net *.msg
<br>><br>> # ------------------------------------------------------------<br>><br>> d2alg: d2algFuncsV2.o d2algMainV2.o COINInterface.o<br>> $(CXX) $(CXXLINKFLAGS) d2algMainV2.o d2algFuncsV2.o COINInterface.o
<br>> -o d2alg $(MPI_LIBS) $(LIBS)<br>> COINInterface.o: $(D2BAC)/ COINInterface.c<br>> $(CXX) -c $(MPI_CFLAGS) $(CXXFLAGS) -I$(COININCDIR)<br>> $(D2BAC)/COINInterface.c -o COINInterface.o<br>> d2algMainV2.o
: $(D2BAC)/ d2algMainV2.c<br>> $(CXX) -c $(MPI_CFLAGS) $(CXXFLAGS) -I$(COININCDIR)<br>> $(D2BAC)/d2algMainV2.c -o d2algMainV2.o<br>> d2algFuncsV2.o: $(D2BAC)/ d2algFuncsV2.c<br>> $(CXX) -c $(MPI_CFLAGS) $(CXXFLAGS) -I$(CINCDIR) -I$(COININCDIR)
<br>> $(D2BAC)/d2algFuncsV2.c -o d2algFuncsV2.o<br>><br>_______________________________________________<br>Coin-discuss mailing list<br><a href="mailto:Coin-discuss@list.coin-or.org">Coin-discuss@list.coin-or.org</a>
<br><a href="http://list.coin-or.org/mailman/listinfo/coin-discuss">http://list.coin-or.org/mailman/listinfo/coin-discuss</a><br></blockquote></div><br>