<div>&nbsp;</div>
<div>Hi Andreas,</div>
<div>&nbsp;</div>
<div>I tried icpc and icc. When compiling COIN&nbsp;without -cxxlib-gcc, the following error comes out during the compilation:</div>
<div>&nbsp;</div>
<div>
<p>CglProbing.cpp(41): error: name must be a namespace name<br>&nbsp; using namespace __gnu_cxx;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^</p>
<p>CglProbing.cpp(128): error: hash_set is not a template<br>&nbsp;&nbsp;&nbsp; hash_set&lt;OsiRowCut2&nbsp; , row_cut_hash, row_cut_compare&gt; rowCut_;<br>&nbsp;&nbsp;&nbsp; ^</p>
<p>CglProbing.cpp(147): error: identifier &quot;hash_set&quot; is undefined<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hash_set&lt;OsiRowCut2 , row_cut_hash, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^</p>
<p>CglProbing.cpp(147): error: type name is not allowed<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hash_set&lt;OsiRowCut2 , row_cut_hash, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^</p>
<p>CglProbing.cpp(147): error: type name is not allowed<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hash_set&lt;OsiRowCut2 , row_cut_hash, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^</p>
<p>CglProbing.cpp(148): error: type name is not allowed<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; row_cut_compare&gt;::iterator find;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^</p>
<p>CglProbing.cpp(148): error: the global scope has no &quot;iterator&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; row_cut_compare&gt;::iterator find;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^</p>
<p>......</p>
<p>If i compile it with CXXFLAGS=&quot;-cxxlib-gcc&quot;, 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&lt;true, 0&gt;::allocate(unsigned)&#39;<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; std::operator&lt;&lt; &lt;std::char_traits&lt;char&gt; &gt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, char const*)&#39;
<br>/home/osu4502/Coin-Cbc/lib/libCoinUtils.so: undefined reference to `std::ostream::operator&lt;&lt;(bool)&#39;<br>/home/osu4502/Coin-Cbc/lib/libOsiClp.so: undefined reference to `std::string::operator=(char const*)&#39;
<br>/home/osu4502/Coin-Cbc/lib/libOsiClp.so: undefined reference to `std::string::compare(char const*) const&#39;<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::string::string(std::string const&amp;)&#39;
<br>/home/osu4502/Coin-Cbc/lib/libClp.so: undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; std::operator&lt;&lt; &lt;std::char_traits&lt;char&gt; &gt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, char)&#39;
<br>/home/osu4502/Coin-Cbc/lib/libOsiClp.so: undefined reference to `std::string::operator=(std::string const&amp;)&#39;<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::allocator&lt;char&gt;::allocator()&#39;
<br>/home/osu4502/Coin-Cbc/lib/libOsiCbc.so: undefined reference to `std::string::size() const&#39;<br>/home/osu4502/Coin-Cbc/lib/libCgl.so: undefined reference to `std::string::append(char const*)&#39;<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::ostream::operator&lt;&lt;(std::ostream&amp; (*)(std::ostream&amp;))&#39;
<br>/home/osu4502/Coin-Cbc/lib/libCgl.so: undefined reference to `std::__throw_length_error(char const*)&#39;<br>/home/osu4502/Coin-Cbc/lib/libCbc.so: undefined reference to `std::ostream::operator&lt;&lt;(void const*)&#39;
<br>/home/osu4502/Coin-Cbc/lib/libOsiCbc.so: undefined reference to `std::string::reserve(unsigned)&#39;<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>&nbsp;</p></div>
<div><span class="gmail_quote">On 6/20/07, <b class="gmail_sendername">Andreas Waechter</b> &lt;<a href="mailto:andreasw@watson.ibm.com">andreasw@watson.ibm.com</a>&gt; 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.&nbsp;&nbsp;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.&nbsp;&nbsp;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>&gt; Hi,<br>&gt;<br>&gt; I am working on a MPI application using COIN-cbc, clp as solvers. The COIN
<br>&gt; shared libraries have been made using gcc, however, my own MPI program<br>&gt; together with COIN failed to compile using mpicc (a compiler and linker<br>&gt; constructed for MPI application). Instead, i use the intel C++ compiler
<br>&gt; &quot;icpc&quot; together with some necessary MPI lib and include files.<br>&gt; Fortunately, the compilation and linking are fine, but on the other hand,<br>&gt; probably it is one of the reason that causes the following errors.
<br>&gt;<br>&gt; If I add the link flags -cxxlib-gcc or -shared while linking my program with<br>&gt; COIN shared libraries. the executable can be successfully generated.<br>&gt; However, everytime i run it, it directly gives me a seg fault even without
<br>&gt; getting into the main function. it is proved by no output of the first<br>&gt; &quot;printf&quot;, as shown below.<br>&gt;<br>&gt; #include ***<br>&gt;<br>&gt; int<br>&gt; main (int argc, char *argv[])<br>&gt; {<br>
&gt;&nbsp;&nbsp;printf (&quot;Beginning of the code.\n&quot;);<br>&gt; ......<br>&gt; }<br>&gt;<br>&gt;<br>&gt;<br>&gt; If I get rid of the link flags -cxxlib-gcc or -shared, the above seg fault<br>&gt; is gone. and the Coin utility functions seem to work fine, but it fails to
<br>&gt; solve a simple MIP problem with output &quot;Cbc: LP relaxation is infeasible or<br>&gt; too expensive&quot;. I write the MIP out, actually the problem is ok and it can<br>&gt; be solved very easily.<br>&gt;<br>&gt; I am suspecting that there might exist some linking errors, so that although
<br>&gt; the libraries (-lCbc -lCgl -lOsiClp -lOsiCbc -lOsi -lClp -lCoinUtils) have<br>&gt; been linked, they don&#39;t function well. I sense the usage of shared libraries<br>&gt; might also be a problem, but so far i have no luck in finding what&#39;s wrong.
<br>&gt; If you have any idea or some experience with using MPI and COIN together,<br>&gt; please kindly provide me some directions. Any suggestion is extremely<br>&gt; appreciated!<br>&gt;<br>&gt; Thanks!<br>&gt;<br>&gt; yang
<br>&gt;<br>&gt; p.s. The following is the makefile i am using:<br>&gt;<br>&gt; /******************************************<br>&gt;<br>&gt; D2BAC=$(HOME)/D2-MPI<br>&gt;<br>&gt; CXX = icpc<br>&gt;<br>&gt; # C++ Compiler options
<br>&gt; CXXFLAGS = -O2 -unroll0 -mp1 -w -ip<br>&gt; # -cxxlib-gcc -gcc-version=323<br>&gt;<br>&gt; # additional C++ Compiler options for linking<br>&gt; CXXLINKFLAGS =<br>&gt; #-Wl,--rpath -Wl,/home/osu4502/Coin-Cbc/lib -cxxlib-gcc
<br>&gt;<br>&gt; # Directory with COIN header files<br>&gt; COININCDIR = $(HOME)/Coin-Cbc-T1/include<br>&gt;<br>&gt; # Directory with COIN libraries<br>&gt; COINLIBDIR = $(HOME)/Coin-Cbc-T1/lib<br>&gt;<br>&gt; # Directory with C library and header files
<br>&gt; CINCDIR = /usr/local/intel-8.0-20040716/include/c++<br>&gt; CLIBDIR = /usr/local/intel-8.0-20040716/lib<br>&gt;<br>&gt; # Libraries necessary to link with Clp<br>&gt; LIBS = -L$(COINLIBDIR) -lCbc -lCgl -lOsiClp -lOsiCbc -lOsi -lClp -lCoinUtils
<br>&gt; \<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -lm -lc \<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `cat $(COINLIBDIR)/cgl_addlibs.txt` \<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `cat $(COINLIBDIR)/osi_addlibs.txt` \<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `cat $(COINLIBDIR)/clp_addlibs.txt` \<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `cat $(COINLIBDIR)/coinutils_addlibs.txt`
<br>&gt;<br>&gt; # ------------------------------------------------------------<br>&gt;<br>&gt; clean :<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /bin/rm -rf *.o *~<br>&gt;<br>&gt; realclean :<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /bin/rm -rf *.o *~<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /bin/rm -rf *.mps *.ord *.sos *.lp *.sav *.net *.msg
<br>&gt;<br>&gt; # ------------------------------------------------------------<br>&gt;<br>&gt; d2alg: d2algFuncsV2.o&nbsp;&nbsp;d2algMainV2.o COINInterface.o<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(CXX) $(CXXLINKFLAGS) d2algMainV2.o d2algFuncsV2.o COINInterface.o
<br>&gt; -o d2alg&nbsp;&nbsp;$(MPI_LIBS) $(LIBS)<br>&gt; COINInterface.o: $(D2BAC)/ COINInterface.c<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(CXX) -c $(MPI_CFLAGS) $(CXXFLAGS) -I$(COININCDIR)<br>&gt; $(D2BAC)/COINInterface.c -o COINInterface.o<br>&gt; d2algMainV2.o
: $(D2BAC)/ d2algMainV2.c<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(CXX) -c $(MPI_CFLAGS) $(CXXFLAGS) -I$(COININCDIR)<br>&gt; $(D2BAC)/d2algMainV2.c -o d2algMainV2.o<br>&gt; d2algFuncsV2.o: $(D2BAC)/ d2algFuncsV2.c<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(CXX) -c $(MPI_CFLAGS) $(CXXFLAGS) -I$(CINCDIR) -I$(COININCDIR)
<br>&gt; $(D2BAC)/d2algFuncsV2.c -o d2algFuncsV2.o<br>&gt;<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>