Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
melody.zhu@mahuika02 ~/gmt> mkdir build
melody.zhu@mahuika02 ~/gmt> cd build
melody.zhu@mahuika02 ~/gmt/build> cmake ..
 

Error:

...


cannot

...

find

...

CURL_INCLUDE_DIR

...

error

Solution:

...

check

...

if

...

you

...

install

...

your

...

custom

...

curl

          edit ccmake..
Code Block
 melody.zhu@mahuika02 ~/gmt/build> ccmake .. 
 # hardcode the path for following variables. Enforce using custom curl and zlib. Editing ConfigUser.cmake will not solve the issue.
 CURL_INCLUDE_DIR                 /home/melody.zhu/bin/curl/include                                                                                                                                                                          
 CURL_LIBRARY                     /home/melody.zhu/bin/curl/lib/libcurl.so
 
 ZLIB_INCLUDE_DIR                 /home/melody.zhu/bin/zlib/include                                                                                                                                                                          
 ZLIB_LIBRARY                     /home/melody.zhu/bin/zlib/lib/libz.so         

...

Code Block
$find . -name "link.txt" | xargs grep lmkl_gf_lp64 | cut -d: -f1 | xargs -I % sed -i -e 's?-lmkl_gf_lp64??g' %

 

Error: 

Code Block
/opt/nesi/mahuika/binutils/2.28-GCCcore-7.1.0/bin/ld: warning: libopenjp2.so.7, needed by /opt/nesi/mahuika/GDAL/2.2.2-gimkl-2017a-GEOS-3.5.1/lib/libgdal.so, not found (try using -rpath or -rpath-link)

...


/opt/nesi/mahuika/binutils/2.28-GCCcore-7.1.0/bin/ld: warning: libpq.so.5, needed by /opt/nesi/mahuika/GDAL/2.2.2-gimkl-2017a-GEOS-3.5.1/lib/libgdal.so, not found (try using -rpath or -rpath-link)

...


/opt/nesi/mahuika/binutils/2.28-GCCcore-7.1.0/bin/ld: warning: libkea.so.1.4.6, needed by /opt/nesi/mahuika/GDAL/2.2.2-gimkl-2017a-GEOS-3.5.1/lib/libgdal.so, not found (try using -rpath or -rpath-link)

...


/opt/nesi/mahuika/GDAL/2.2.2-gimkl-2017a-GEOS-3.5.1/lib/libgdal.so: undefined reference to `kealib::KEAImageIO::setImageBandClrInterp(unsigned int, kealib::KEABandClrInterp)'

...


/opt/nesi/mahuika/GDAL/2.2.2-gimkl-2017a-GEOS-3.5.1/lib/libgdal.so: undefined reference to `PQputCopyEnd'

...


/opt/nesi/mahuika/GDAL/2.2.2-gimkl-2017a-GEOS-3.5.1/lib/libgdal.so: undefined reference to `opj_create_compress'

 

Solution: 

Check

...

modules:OpenJPEG/2.3.0-gimkl-2017a,

...

KEALib/1.4.6-gimkl-2017a

...

and

...

PostgreSQL/9.6.2-gimkl-2017a

...

are

...

loaded.
Check

...

the

...

above

...

modules

...

are

...

in

...

PATH;

...

Their

...

libs

...

are

...

in

...

LD_LIBRARY_PATH

Code Block
melody.zhu@mahuika02 /scale_wlg_persistent/filesets/project/nesi00213/share> module show KEALib/1.4.6-gimkl-2017a
prepend_path("LD_LIBRARY_PATH","/opt/nesi/mahuika/KEALib/1.4.6-gimkl-2017a/lib")
prepend_path("LIBRARY_PATH","/opt/nesi/mahuika/KEALib/1.4.6-gimkl-2017a/lib")
prepend_path("PATH","/opt/nesi/mahuika/KEALib/1.4.6-gimkl-2017a/bin")

# Add missing libs to LD_LIBRARY_PATH: (use 'module show' to see each module path)
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/nesi/mahuika/PostgreSQL/9.6.2-gimkl-2017a/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/nesi/mahuika/OpenJPEG/2.3.0-gimkl-2017a/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/nesi/mahuika/KEALib/1.4.6-gimkl-2017a/lib

 

Error:

...

Code Block
Linking C executable gmt /opt/nesi/mahuika/libpng/1.6.28-gimkl-2017a/lib/libpng16.so.16: undefined reference to `inflateValidate@ZLIB_1.2.9

 

Solution:

...


check

...

if

...

you

...

install

...

your

...

custom

...

libpng

...

using

...

your

...

custom

...

zlib

...

(see

...

point

...

3)

          check if you have the correct ZLIB_INCLUDE_DIR and ZLIB_LIBRARY in ccmake
          check src/CMakeFiles/gmt.dir/link.txt and edit so cmake can find libs for your custom curl and zlib
Code Block
melody.zhu@mahuika02 ~/gmt/build> vim src/CMakeFiles/gmt.dir/link.txt
/usr/bin/cc  -std=gnu99  -ggdb3 -O2 -Wuninitialized    CMakeFiles/gmt.dir/gmt.c.o  -o gmt -rdynamic libgmt.so.6.0.0 /cm/shared/apps/netcdf/gcc/64/4.4.0/lib/libnetcdf.so /home/melody.zhu/bin/curl/lib/libcurl.so -lgdal -lpcre -lfftw3f -lfftw3f_threads -lblas libpostscriptlight.so.6.0.0 /home/melody.zhu/bin/zlib/lib/libz.so -lm -ldl -Wl,-rpath,/home/melody.zhu/gmt/build/src:/cm/shared/apps/netcdf/gcc/64/4.4.0/lib:/home/melody.zhu/bin/curl/lib:/home/melody.zhu/bin/zlib/lib

  

When

...

no

...

error

...

running

...

cmake ..

Do
Code Block
melody.zhu@mahuika02 ~/gmt/build> cmake ..
melody.zhu@mahuika02 ~/gmt/build> make
melody.zhu@mahuika02 ~/gmt/build> make install DESTDIR=/home/melody.zhu/bin

...