[Cbc] Problem in Compling CBC in Mac OS X

Ted Ralphs ted at lehigh.edu
Thu Jan 15 18:34:06 EST 2015


Hi all,

I was able to replicate the problem Noli had with building cbc parallel and
John's fix seems to work for me with clang. I am on OS X 10.9 and build
with both clang and gcc (the fix was tested with clang).

Cheers,

Ted

On Thu, Jan 15, 2015 at 3:56 AM, John Forrest <john.forrest at fastercoin.com>
wrote:

> Noli,
>
> Change was to Clp (2085).
>
> Looking at your pthread.h, I can see there are no definitions for
> barriers.  I have now changed my previous commit to use
> PTHREAD_BARRIER_SERIAL_THREAD as that indicates existence of barriers
> (2086).
>
> John
>
> On 14/01/15 21:54, Noli Sicad wrote:
>
>> Hi John,
>>
>> Here attached is the pthreads.h from Mac OS X 10.8 SDK.
>>
>>  Is trunk OK now.
>>>
>> Not downloaded the trunk yet since it seems the number is not updated
>> (i.e. 2108) yet.
>>
>> What are the changes?  Can I just edit the previous code?
>>
>> Thanks, Noli
>>
>>
>>
>> On 1/14/15, John Forrest <john.forrest at fastercoin.com> wrote:
>>
>>> Noli,
>>>
>>> Not sure why pthread_barrier_t not defined in Mac pthreads.h - can you
>>> send me the Mac copy?
>>>
>>> That bit of code not really used (by normal people), so I have modified
>>> it a bit.
>>>
>>> There is now a NORMAL_THREADS define which can be set by user -- or will
>>> be set by some other options.
>>>
>>> Is trunk OK now.
>>>
>>> John
>>>
>>> On 14/01/15 05:12, Noli Sicad wrote:
>>>
>>>> Hi Ted,
>>>>
>>>> I am using Mac OS X 10.8.3 and GCC 4.7.
>>>>
>>>> 1.5 years ago I was able compile CBC with the GCC 4.7. However, the
>>>> last 6 months I have problems.
>>>>
>>>> I tried this (below) as well. I got error as well.
>>>>
>>>> ./configure  --enable-cbc-parallel --enable-gnu-packages
>>>> --enable-debug -C --prefix=/usr/local
>>>>
>>>> I am using the latest source code
>>>>
>>>> source: trunk/Cbc @ 2108
>>>>
>>>> I don't want to upgrade my GCC to 4.9 since  a lot of work.
>>>>
>>>> Ted, what version GCC you are using and what version of Mac OS X you
>>>> are running?
>>>>
>>>> Here's the error (below).
>>>>
>>>> Noli
>>>>
>>>> ~~~~
>>>> /Glpk/glpk/include
>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/
>>>> Glpk/glpk/src/amd
>>>> -DCOIN_NO_CLP_MESSAGE -DUSE_CBCCONFIG -g -O0 -pipe -Wparentheses
>>>> -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings
>>>> -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCBC_BUILD -MT
>>>> CbcBranchDefaultDecision.lo -MD -MP -MF
>>>> .deps/CbcBranchDefaultDecision.Tpo -c CbcBranchDefaultDecision.cpp -o
>>>> CbcBranchDefaultDecision.o
>>>> In file included from CbcSubProblem.hpp:12:0,
>>>>                    from CbcGeneralDepth.hpp:13,
>>>>                    from CbcBranchActual.hpp:21,
>>>>                    from CbcBranchDefaultDecision.cpp:24:
>>>> /Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src/
>>>> ClpSimplex.hpp:1763:10:
>>>> error: 'pthread_barrier_t' does not name a type
>>>> /Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src/
>>>> ClpSimplex.hpp:1779:3:
>>>> error: 'pthread_barrier_t' does not name a type
>>>> In file included from
>>>> /Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Osi/src/Osi/
>>>> OsiSolverInterface.hpp:17:0,
>>>>                    from CbcBranchDefaultDecision.cpp:19:
>>>> /Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/CoinUtils/src/
>>>> CoinFinite.hpp:20:14:
>>>> warning: 'COIN_INT_MAX_AS_DOUBLE' defined but not used
>>>> [-Wunused-variable]
>>>> make[3]: *** [CbcBranchDefaultDecision.lo] Error 1
>>>> make[2]: *** [all] Error 2
>>>> make[1]: *** [all-recursive] Error 1
>>>> make: *** [all-recursive] Error 1
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 1/14/15, Ted Ralphs <ted at lehigh.edu> wrote:
>>>>
>>>>> Overriding CFLAGS and CXXFLAGS will cause problems in most cases. If
>>>>> you
>>>>> want to add extra flags for some reason, you can use ADD_CFLAGS and
>>>>> ADD_CXXFLAGS, but in general, you should not have to add flags like
>>>>> "-arch
>>>>> x86_64". If you are trying to build binaries that target a different
>>>>> architecture than the one you are building on, i.e., cross-compile,
>>>>> there
>>>>> are arguments to configure to accomplish that. See the explanation
>>>>> here:
>>>>>
>>>>> http://www.gnu.org/software/automake/manual/html_node/
>>>>> Cross_002dCompilation.html
>>>>>
>>>>> I guess that not defining those variables should fix the problem, but
>>>>> if
>>>>> not, please provide some more details, such as what specific version of
>>>>> Cbc
>>>>> you are trying to build, and I will try to help. I build Cbc on OS X on
>>>>> a
>>>>> regular basis.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Ted
>>>>>
>>>>> On Tue, Jan 13, 2015 at 8:36 PM, Noli Sicad <nsicad at gmail.com> wrote:
>>>>>
>>>>>  Hi,
>>>>>>
>>>>>> I got problem compiling in Mac OS X 10.8, GCC 4.7
>>>>>>
>>>>>>
>>>>>> ./configure CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64"
>>>>>> --enable-cbc-parallel --enable-gnu-packages  --enable-debug -C
>>>>>> --prefix=/usr/local
>>>>>>
>>>>>> Here the error below.
>>>>>>
>>>>>> How do I fix this error?
>>>>>>
>>>>>> Thanks, Noli
>>>>>>
>>>>>>
>>>>>> Making all in Cbc
>>>>>> Making all in src
>>>>>> make  all-am
>>>>>> if /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H
>>>>>> -I. -I`echo .` -I../src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglAllDifferent
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglClique
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglDuplicateRow
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglFlowCover
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglGMI
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglGomory
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglKnapsackCover
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglLandP
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglLiftAndProject
>>>>>>
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglMixedIntegerRounding
>>>>>>
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglMixedIntegerRounding2
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglOddHole
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglPreProcess
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglProbing
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglRedSplit
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglRedSplit2
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglResidualCapacity
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglSimpleRounding
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglTwomir
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglZeroHalf
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src/OsiClp
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Osi/src/Osi
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/CoinUtils/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/Glpk
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/
>>>>>> Glpk/glpk/include
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/
>>>>>> Glpk/glpk/src/amd
>>>>>>     -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src/OsiClp
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Osi/src/Osi
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/CoinUtils/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/Glpk
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/
>>>>>> Glpk/glpk/include
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/
>>>>>> Glpk/glpk/src/amd
>>>>>>        -DCOIN_NO_CLP_MESSAGE -DUSE_CBCCONFIG   -arch x86_64
>>>>>> -DCBC_BUILD -MT CbcBranchDefaultDecision.lo -MD -MP -MF
>>>>>> ".deps/CbcBranchDefaultDecision.Tpo" -c -o
>>>>>> CbcBranchDefaultDecision.lo
>>>>>> CbcBranchDefaultDecision.cpp; \
>>>>>>           then mv -f ".deps/CbcBranchDefaultDecision.Tpo"
>>>>>> ".deps/CbcBranchDefaultDecision.Plo"; else rm -f
>>>>>> ".deps/CbcBranchDefaultDecision.Tpo"; exit 1; fi
>>>>>>    g++ -DHAVE_CONFIG_H -I. -I. -I../src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglAllDifferent
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglClique
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglDuplicateRow
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglFlowCover
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglGMI
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglGomory
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglKnapsackCover
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglLandP
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglLiftAndProject
>>>>>>
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglMixedIntegerRounding
>>>>>>
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglMixedIntegerRounding2
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglOddHole
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglPreProcess
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglProbing
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglRedSplit
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglRedSplit2
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglResidualCapacity
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/
>>>>>> CglSimpleRounding
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglTwomir
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Cgl/src/CglZeroHalf
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src/OsiClp
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Osi/src/Osi
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/CoinUtils/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/Glpk
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/
>>>>>> Glpk/glpk/include
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/
>>>>>> Glpk/glpk/src/amd
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src/OsiClp
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Osi/src/Osi
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/CoinUtils/src
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/Glpk
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/
>>>>>> Glpk/glpk/include
>>>>>> -I/Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/ThirdParty/
>>>>>> Glpk/glpk/src/amd
>>>>>> -DCOIN_NO_CLP_MESSAGE -DUSE_CBCCONFIG -arch x86_64 -DCBC_BUILD -MT
>>>>>> CbcBranchDefaultDecision.lo -MD -MP -MF
>>>>>> .deps/CbcBranchDefaultDecision.Tpo -c CbcBranchDefaultDecision.cpp -o
>>>>>> CbcBranchDefaultDecision.o
>>>>>> In file included from CbcSubProblem.hpp:12:0,
>>>>>>                    from CbcGeneralDepth.hpp:13,
>>>>>>                    from CbcBranchActual.hpp:21,
>>>>>>                    from CbcBranchDefaultDecision.cpp:24:
>>>>>> /Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src/
>>>>>> ClpSimplex.hpp:1763:10:
>>>>>> error: 'pthread_barrier_t' does not name a type
>>>>>> /Users/nsicad/Documents/A_CBC/coin-Cbc/cbc/Clp/src/
>>>>>> ClpSimplex.hpp:1779:3:
>>>>>> error: 'pthread_barrier_t' does not name a type
>>>>>> make[3]: *** [CbcBranchDefaultDecision.lo] Error 1
>>>>>> make[2]: *** [all] Error 2
>>>>>> make[1]: *** [all-recursive] Error 1
>>>>>> make: *** [all-recursive] Error 1
>>>>>> _______________________________________________
>>>>>> Cbc mailing list
>>>>>> Cbc at list.coin-or.org
>>>>>> http://list.coin-or.org/mailman/listinfo/cbc
>>>>>>
>>>>>>
>>>>> --
>>>>> Dr. Ted Ralphs
>>>>> Professor, Lehigh University
>>>>> (610) 628-1280
>>>>> ted 'at' lehigh 'dot' edu
>>>>> coral.ie.lehigh.edu/~ted
>>>>>
>>>>>  _______________________________________________
>>>> Cbc mailing list
>>>> Cbc at list.coin-or.org
>>>> http://list.coin-or.org/mailman/listinfo/cbc
>>>>
>>>>
>>>>  _______________________________________________
>>> Cbc mailing list
>>> Cbc at list.coin-or.org
>>> http://list.coin-or.org/mailman/listinfo/cbc
>>>
>>>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc
>



-- 
Dr. Ted Ralphs
Professor, Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20150115/32aac4b9/attachment-0001.html>


More information about the Cbc mailing list