Re: [netcdfgroup] CMake integration with NetCDF

On 10/02/2012 10:16 AM, Ward Fisher wrote:
The CMake-integrated source code is not yet part of an official release,
but it may be
checked out from our public subversion repository:

svn checkout http://svn.unidata.ucar.edu/repos/netcdf/trunk netcdf

CMake 2.8.8+ is required. CMake may be downloaded from
http://www.cmake.org.  Instructions
for building NetCDF-C with CMake are described in the
'COMPILE_CMAKE.txt' file found in
the root NetCDF-C directory, or at

http://www.unidata.ucar.edu/software/netcdf/CompileCMake.html.


Looks like some issues with not using -fPIC on x86_64:

[  1%] Building C object libdispatch/CMakeFiles/dispatch.dir/dcopy.c.o
cd /builddir/build/BUILD/netcdf-4.2.1/build/libdispatch && /usr/lib64/ccache/gcc -DCURL_STATICLIB=1 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/builddir/build/BUILD/netcdf-4.2.1/build/libdispatch -I/builddir/build/BUILD/netcdf-4.2.1/libdispatch -I/builddir/build/BUILD/netcdf-4.2.1/build -I/builddir/build/BUILD/netcdf-4.2.1/include -I/builddir/build/BUILD/netcdf-4.2.1/oc2 -I/builddir/build/BUILD/netcdf-4.2.1/libdispatch/. -o CMakeFiles/dispatch.dir/dcopy.c.o -c /builddir/build/BUILD/netcdf-4.2.1/libdispatch/dcopy.c

...

Linking C shared library libnetcdf.so
cd /builddir/build/BUILD/netcdf-4.2.1/build/liblib && /usr/bin/cmake -E cmake_link_script CMakeFiles/netcdf.dir/link.txt --verbose=1 /usr/lib64/ccache/gcc -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wl,-z,relro -shared -Wl,-soname,libnetcdf.so -o libnetcdf.so CMakeFiles/netcdf.dir/stub.c.o ../libdispatch/CMakeFiles/dispatch.dir/dparallel.c.o ../libdispatch/CMakeFiles/dispatch.dir/dcopy.c.o ../libdispatch/CMakeFiles/dispatch.dir/dfile.c.o ../libdispatch/CMakeFiles/dispatch.dir/ddim.c.o ../libdispatch/CMakeFiles/dispatch.dir/datt.c.o ../libdispatch/CMakeFiles/dispatch.dir/dattinq.c.o ../libdispatch/CMakeFiles/dispatch.dir/dattput.c.o ../libdispatch/CMakeFiles/dispatch.dir/dattget.c.o ../libdispatch/CMakeFiles/dispatch.dir/derror.c.o ../libdispatch/CMakeFiles/dispatch.dir/dvar.c.o ../libdispatch/CMakeFiles/dispatch.dir/dvarget.c.o ../libdispatch/CMakeFiles/dispatch.dir/dvarput.c.o ../libdispatch/CMakeFiles/dispatch.dir/dvarinq.c.o ../libdispatch/CMakeFiles/dispatch.dir/ddispatch.c.o ../libdispatch/CMakeFiles/dispatch.dir/nclog.c.o ../libdispatch/CMakeFiles/dispatch.dir/dstring.c.o ../libdispatch/CMakeFiles/dispatch.dir/dutf8proc.c.o ../libdispatch/CMakeFiles/dispatch.dir/ncuri.c.o ../libdispatch/CMakeFiles/dispatch.dir/nclist.c.o ../libdispatch/CMakeFiles/dispatch.dir/ncbytes.c.o ../libdispatch/CMakeFiles/dispatch.dir/nchashmap.c.o ../libdispatch/CMakeFiles/dispatch.dir/nctime.c.o ../libdispatch/CMakeFiles/dispatch.dir/dsubstrate.c.o ../libdispatch/CMakeFiles/dispatch.dir/nc.c.o ../libdispatch/CMakeFiles/dispatch.dir/nclistmgr.c.o ../libdispatch/CMakeFiles/dispatch.dir/dgroup.c.o ../libdispatch/CMakeFiles/dispatch.dir/dvlen.c.o ../libdispatch/CMakeFiles/dispatch.dir/dcompound.c.o ../libdispatch/CMakeFiles/dispatch.dir/dtype.c.o ../libdispatch/CMakeFiles/dispatch.dir/denum.c.o ../libdispatch/CMakeFiles/dispatch.dir/dopaque.c.o ../libdispatch/CMakeFiles/dispatch.dir/ncaux.c.o ../libdispatch/CMakeFiles/dispatch.dir/dv2i.c.o ../libsrc/CMakeFiles/netcdf3.dir/v1hpg.c.o ../libsrc/CMakeFiles/netcdf3.dir/putget.c.o ../libsrc/CMakeFiles/netcdf3.dir/attr.c.o ../libsrc/CMakeFiles/netcdf3.dir/nc3dispatch.c.o ../libsrc/CMakeFiles/netcdf3.dir/nc3internal.c.o ../libsrc/CMakeFiles/netcdf3.dir/var.c.o ../libsrc/CMakeFiles/netcdf3.dir/dim.c.o ../libsrc/CMakeFiles/netcdf3.dir/ncx.c.o ../libsrc/CMakeFiles/netcdf3.dir/lookup3.c.o ../libsrc/CMakeFiles/netcdf3.dir/ncio.c.o ../libsrc/CMakeFiles/netcdf3.dir/posixio.c.o ../libsrc4/CMakeFiles/netcdf4.dir/nc4dispatch.c.o ../libsrc4/CMakeFiles/netcdf4.dir/nc4attr.c.o ../libsrc4/CMakeFiles/netcdf4.dir/nc4dim.c.o ../libsrc4/CMakeFiles/netcdf4.dir/nc4file.c.o ../libsrc4/CMakeFiles/netcdf4.dir/nc4grp.c.o ../libsrc4/CMakeFiles/netcdf4.dir/nc4type.c.o ../libsrc4/CMakeFiles/netcdf4.dir/nc4var.c.o ../libsrc4/CMakeFiles/netcdf4.dir/ncfunc.c.o ../libsrc4/CMakeFiles/netcdf4.dir/nc4internal.c.o ../libsrc4/CMakeFiles/netcdf4.dir/nc4hdf.c.o ../oc2/CMakeFiles/oc2.dir/occurlfunctions.c.o ../oc2/CMakeFiles/oc2.dir/dapparse.c.o ../oc2/CMakeFiles/oc2.dir/daplex.c.o ../oc2/CMakeFiles/oc2.dir/ocdata.c.o ../oc2/CMakeFiles/oc2.dir/ocuri.c.o ../oc2/CMakeFiles/oc2.dir/ochttp.c.o ../oc2/CMakeFiles/oc2.dir/ocbytes.c.o ../oc2/CMakeFiles/oc2.dir/oc.c.o ../oc2/CMakeFiles/oc2.dir/ocdebug.c.o ../oc2/CMakeFiles/oc2.dir/ocdump.c.o ../oc2/CMakeFiles/oc2.dir/ocinternal.c.o ../oc2/CMakeFiles/oc2.dir/occompile.c.o ../oc2/CMakeFiles/oc2.dir/oclist.c.o ../oc2/CMakeFiles/oc2.dir/oclog.c.o ../oc2/CMakeFiles/oc2.dir/ocnode.c.o ../oc2/CMakeFiles/oc2.dir/ocutil.c.o ../oc2/CMakeFiles/oc2.dir/occlientparams.c.o ../oc2/CMakeFiles/oc2.dir/ocrc.c.o ../oc2/CMakeFiles/oc2.dir/ocread.c.o ../oc2/CMakeFiles/oc2.dir/xxdr.c.o ../oc2/CMakeFiles/oc2.dir/daptab.c.o ../libdap2/CMakeFiles/dap2.dir/constraints3.c.o ../libdap2/CMakeFiles/dap2.dir/common34.c.o ../libdap2/CMakeFiles/dap2.dir/dapcvt.c.o ../libdap2/CMakeFiles/dap2.dir/dapalign.c.o ../libdap2/CMakeFiles/dap2.dir/dapodom.c.o ../libdap2/CMakeFiles/dap2.dir/daputil.c.o ../libdap2/CMakeFiles/dap2.dir/ncdaperr.c.o ../libdap2/CMakeFiles/dap2.dir/cdf3.c.o ../libdap2/CMakeFiles/dap2.dir/cache.c.o ../libdap2/CMakeFiles/dap2.dir/dapdump.c.o ../libdap2/CMakeFiles/dap2.dir/dapdebug.c.o ../libdap2/CMakeFiles/dap2.dir/dapattr3.c.o ../libdap2/CMakeFiles/dap2.dir/ncd3dispatch.c.o ../libdap2/CMakeFiles/dap2.dir/ncdap3.c.o ../libdap2/CMakeFiles/dap2.dir/ncdap3a.c.o ../libdap2/CMakeFiles/dap2.dir/getvara3.c.o ../libdap2/CMakeFiles/dap2.dir/dceconstraints.c.o ../libdap2/CMakeFiles/dap2.dir/dcetab.c.o ../libdap2/CMakeFiles/dap2.dir/dceparse.c.o ../libdap2/CMakeFiles/dap2.dir/dcelex.c.o -lm -lz -lcurl -lz -lrt -lm -lhdf5_hl -lhdf5 -lz -lcurl -lrt -lhdf5_hl -lhdf5 /usr/bin/ld: ../libdispatch/CMakeFiles/dispatch.dir/dcopy.c.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC ../libdispatch/CMakeFiles/dispatch.dir/dcopy.c.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status


--
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  orion@xxxxxxxxxxxxx
Boulder, CO 80301              http://www.cora.nwra.com



  • 2012 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: