[MOAB-dev] Problems with MOABConfig.cmake

Vijay S. Mahadevan vijay.m at gmail.com
Mon Dec 8 23:46:48 CST 2014


John,

Give this branch a shot. I'm not done yet though.

https://bitbucket.org/fathomteam/moab/branch/vijaysm/cmake-config-output

Vijay

On Mon, Dec 8, 2014 at 9:12 AM, JR Cary <cary at txcorp.com> wrote:
> One more thing.  My configure line was
>
>   '/Users/cary/projects/dagmcall/moab/configure' \
>   --prefix=/volatile/moab-master.r5242-ser \
>   --enable-static \
>   --disable-shared \
>   CC='/usr/bin/clang' \
>   CXX='/usr/bin/clang++' \
>   FC='/usr/local/bin/gfortran' \
>   F77='/usr/local/bin/gfortran' \
>   CFLAGS='-pipe' \
>   CXXFLAGS='-stdlib=libstdc++ -pipe' \
>   --enable-dagmc \
>   --without-vtk \
>   --with-hdf5='/contrib/hdf5-1.8.13-ser' \
>   --with-netcdf='/contrib/netcdf-4.3.2-ser'
>
> in case you want to test on Darwin.
>
> Best.....John
>
>
> On 12/8/14, 8:10 AM, JR Cary wrote:
>
> Hi Vijay,
>
> The problem with the -n appearing everywhere
> is that sed on OSX is not gnu sed.  So, on linux:
>
> $ echo foo | sed 's/f/f\n/'
> f
> oo
>
> But on Darwin
>
> $ echo foo | sed 's/f/f\n/'
> fnoo
>
> Thus the code under
>
> install-data-hook:
>
> is invalid on OSX.
>
> I see what you are trying to do.  One way would be
> to get all replacements done except PREFIX in MOABConfig.cmake
> at configure time, then replace PREFIX at installation time.
>
> With regard to the libaries, keeping that long string of -L's
> and -l's may work for now, but cmake does not guarantee that
> syntax.  With something like
>
> link_directories(/volatile/moab-master.r5242-ser/lib
> /contrib/netcdf-4.3.2-ser/lib /contrib/hdf5-1.8.13-ser/lib)
> set(MOAB_LIBRARY_NAMES MOAB netcdf hdf5_hl hdf5 pthread z dl m)
> set(DAGMC_LIBRARY_NAMES dagmc ${MOAB_LIBRARY_NAMES})
>
> CMake will not fail down the road someday.
>
> Best......John
>
>
>
>
>
> On 11/29/14, 8:04 AM, Vijay S. Mahadevan wrote:
>
> Thanks for the bug report John. We will push a fix to the MOABConfig
> generation.
>
> We can split the directory and library as separate variables but this
> follows the autoconf based moab.make that uses the mixed convention. Is
> there a specific reason why you want them separately? Apps using MOAB should
> directly use that line to link anyway.
>
> Vijay
>
> On Nov 28, 2014 11:05 PM, "JR Cary" <cary at txcorp.com> wrote:
>>
>> Dear moab folks,
>>
>> I just configure moab with
>>
>> '/Users/cary/projects/dagmcall/moab/configure'
>> --prefix=/volatile/moab-master.r5237-sersh --disable-static --enable-shared
>> CC='/usr/bin/clang' CXX='/usr/bin/clang++' FC='/usr/local/bin/gfortran'
>> F77='/usr/local/bin/gfortran' CXXFLAGS='-stdlib=libstdc++' FFLAGS='-pipe
>> -fPIC' FCFLAGS='-pipe -fPIC' --enable-dagmc --without-vtk
>> --with-hdf5='/contrib/hdf5-1.8.13-sersh'
>>
>> on Darwin.  It built and installed, but at the end of the cmake
>> configuration file (lib/MOABConfig.cmake) I see many lines beginning
>> with '-n' and then 'n' at line endings:
>>
>> # Library and include defs
>> SET(MOAB_INCLUDE_DIRS "/volatile/moab-master.r5237-sersh/include")
>> -n SET(MOAB_LIBRARIES "
>> -n          -L/contrib/hdf5-1.8.13-sersh/lib
>> -L/volatile/moab-master.r5237-sersh/lib -lMOAB  -lc++ -lpthread -lz -ldl -lm
>> -lhdf5")n
>> -n SET(DAGMC_LIBRARIES "
>> -n          -L/contrib/hdf5-1.8.13-sersh/lib
>> -L/volatile/moab-master.r5237-sersh/lib -ldagmc -lMOAB  -lc++ -lpthread -lz
>> -ldl -lm    -lhdf5")n
>>
>> This causes any cmake project depending on moab to fail.
>>
>> It is also a bit strange, in that in cmake-land, libraries are what
>> is after the -l, and LIBRARY_DIRS are what is after the -L.
>>
>> ......John
>
>
>


More information about the moab-dev mailing list