nlesc-dirac / sagecal

SAGECal is a fast, memory efficient and GPU accelerated radio interferometric calibration program. It supports all source models including points, Gaussians and Shapelets. Distributed calibration using MPI and consensus optimization is enabled. Both spectral and spatial priors can be used as constraints. Tools to build/restore sky models are included.
http://sagecal.sourceforge.net
GNU General Public License v2.0
12 stars 8 forks source link

Does not build with CMake on MacOS #46

Closed tammojan closed 5 years ago

tammojan commented 6 years ago

Two things are preventing sagecal to build on my machine (with cmake): myblas is not properly linked in, and openblas is not linked. CMake version is 3.8.2.

➜  build git:(openblas_root) ✗ cmake .. -DCASACORE_ROOT_DIR=~/opt/casacore -DOpenBLAS_ROOT_DIR=/usr/local/opt/openblas -DENABLE_CUDA=Off
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
--
############################
#   Building SageCal v0.6.0
############################
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
--
############################
#   Searching Sagecal dependencies
############################
-- Found WCSLIB: /usr/local/lib/libwcs.dylib
-- Found CFITSIO: /usr/local/lib/libcfitsio.dylib (found version "3.390")
-- Looking for dgemm_
-- Looking for dgemm_ - found
-- A library with BLAS API found.
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /usr/local/Cellar/hdf5/1.10.0-patch1/lib/libhdf5.dylib;/usr/local/opt/szip/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib (found version "1.10.0.1")
-- Found the following Casacore components:
--   coordinates
--   images
--   msfits
--   lattices
--   mirlib
--   fits
--   ms
--   measures
--   scimath
--   tables
--   scimath_f
--   casa
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Found OpenBLAS libraries: /usr/local/opt/openblas/lib/libopenblas.dylib
-- Found OpenBLAS include: /System/Library/Frameworks/vecLib.framework/Headers
-- Checking for module 'glib-2.0'
--   Found glib-2.0, version 2.54.3
--
############################
#   Configuration summary
############################
-- CMAKE_SYSTEM .......... = Darwin-17.4.0
-- CMAKE_BUILD_TYPE ...... =
-- BUILD_SHARED_LIBS ..... =
-- CMAKE_INSTALL_NAME_DIR  =
-- USE_STACKTRACE ........ =
-- CMAKE_CXX_COMPILER .... = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- CMAKE_CXX_FLAGS ....... = -g -O3 -Wall -Wextra -std=c++11 -W -pedantic -ansi -fPIC -fpermissive -fno-omit-frame-pointer -fno-inline-functions -fno-inline-functions-called-once -fno-optimize-sibling-calls
-- ENABLE_MPI ............ = OFF
-- ENABLE_CUDA ........... = Off
-- CASACORE_INC........... = /Users/dijkema/opt/casacore/include
-- CASACORE_LIB........... = /Users/dijkema/opt/casacore/lib/libcasa_coordinates.dylib;/Users/dijkema/opt/casacore/lib/libcasa_images.dylib;/Users/dijkema/opt/casacore/lib/libcasa_msfits.dylib;/Users/dijkema/opt/casacore/lib/libcasa_lattices.dylib;/Users/dijkema/opt/casacore/lib/libcasa_mirlib.dylib;/Users/dijkema/opt/casacore/lib/libcasa_fits.dylib;/Users/dijkema/opt/casacore/lib/libcasa_ms.dylib;/Users/dijkema/opt/casacore/lib/libcasa_measures.dylib;/Users/dijkema/opt/casacore/lib/libcasa_scimath.dylib;/Users/dijkema/opt/casacore/lib/libcasa_tables.dylib;/Users/dijkema/opt/casacore/lib/libcasa_scimath_f.dylib;/System/Library/Frameworks/Accelerate.framework;/System/Library/Frameworks/Accelerate.framework;/Users/dijkema/opt/casacore/lib/libcasa_casa.dylib;/usr/local/Cellar/hdf5/1.10.0-patch1/lib/libhdf5.dylib;/usr/local/opt/szip/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib;/usr/lib/libm.dylib
-- OpenBLAS-LIB .......... = /usr/local/opt/openblas/lib/libopenblas.dylib
-- GLIB-INC .............. = /usr/local/Cellar/glib/2.54.3/include/glib-2.0;/usr/local/Cellar/glib/2.54.3/lib/glib-2.0/include;/usr/local/opt/gettext/include;/usr/local/Cellar/pcre/8.41/include
-- GLIB-LIBS ............. = glib-2.0;intl
-- LAPACK-LIBS ........... = /System/Library/Frameworks/Accelerate.framework;/System/Library/Frameworks/Accelerate.framework
-- CFITSIO-INC  .......... = /usr/local/include
-- CFITSIO-LIBS .......... = /usr/local/lib/libcfitsio.dylib;/usr/lib/libm.dylib
-- WCSLIB-INC  ........... = /usr/local/include
-- WCSLIB-LIBS ........... = /usr/local/lib/libwcs.dylib;/usr/lib/libm.dylib
-- HDF5-INC  ........... = /usr/local/Cellar/hdf5/1.10.0-patch1/include;/usr/include;/usr/local/opt/szip/include
-- HDF5-LIBS ........... = /usr/local/Cellar/hdf5/1.10.0-patch1/lib/libhdf5.dylib;/usr/local/opt/szip/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib
--

Configuring lib/Dirac
-- Compiling lib/Dirac without CUDA support.
-- lib/Dirac objects --> admm_solve;clmfit_nocuda;manifold_average;mdl;myblas;robust_lbfgs_nocuda;robustlm;rtr_solve_robust_admm;updatenu;lmfit_nocuda;consensus_poly;lbfgs_nocuda;rtr_solve;rtr_solve_robust
--

Configuring lib/Radio
-- Compiling lib/Radio without CUDA support.
-- lib/Radio objects --> readsky;predict;residual;transforms;stationbeam;predict_withbeam
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/dijkema/opt/sagecal/sagecal/build
➜  build git:(openblas_root) ✗ make
Scanning dependencies of target rtr_solve_robust
[  1%] Building C object src/lib/Dirac/CMakeFiles/rtr_solve_robust.dir/rtr_solve_robust.c.o
[  3%] Linking C shared library ../../../dist/lib/librtr_solve_robust.dylib
Undefined symbols for architecture x86_64:
  "_my_caxpy", referenced from:
      _fns_R in rtr_solve_robust.c.o
      _itrr in rtr_solve_robust.c.o
      _tcg_solve in rtr_solve_robust.c.o
      _nsd_solve_nocuda_robust in rtr_solve_robust.c.o
  "_my_ccopy", referenced from:
      _rtr_solve_nocuda_robust in rtr_solve_robust.c.o
      _armijostep in rtr_solve_robust.c.o
      _fns_R in rtr_solve_robust.c.o
      _itrr in rtr_solve_robust.c.o
      _tcg_solve in rtr_solve_robust.c.o
      _nsd_solve_nocuda_robust in rtr_solve_robust.c.o
      _fns_proj in rtr_solve_robust.c.o
      ...
  "_my_cdot", referenced from:
      _fns_g in rtr_solve_robust.c.o
      _fns_proj in rtr_solve_robust.c.o
  "_my_cnrm2", referenced from:
      _itrr in rtr_solve_robust.c.o
      _nsd_solve_nocuda_robust in rtr_solve_robust.c.o
  "_my_cscal", referenced from:
      _armijostep in rtr_solve_robust.c.o
      _itrr in rtr_solve_robust.c.o
      _fns_fgrad in rtr_solve_robust.c.o
      _tcg_solve in rtr_solve_robust.c.o
      _nsd_solve_nocuda_robust in rtr_solve_robust.c.o
  "_my_dcopy", referenced from:
      _rtr_solve_nocuda_robust in rtr_solve_robust.c.o
      _nsd_solve_nocuda_robust in rtr_solve_robust.c.o
  "_my_ddot", referenced from:
      _nsd_solve_nocuda_robust in rtr_solve_robust.c.o
  "_my_dscal", referenced from:
      _fns_fcount in rtr_solve_robust.c.o
  "_my_idamax", referenced from:
      _fns_fcount in rtr_solve_robust.c.o
  "_my_zgels", referenced from:
      _fns_proj in rtr_solve_robust.c.o
  "_my_zgemm", referenced from:
      _fns_proj in rtr_solve_robust.c.o
  "_setweights", referenced from:
      _rtr_solve_nocuda_robust in rtr_solve_robust.c.o
      _nsd_solve_nocuda_robust in rtr_solve_robust.c.o
  "_update_nu", referenced from:
      _fns_fupdate_weights in rtr_solve_robust.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [dist/lib/librtr_solve_robust.dylib] Error 1
make[1]: *** [src/lib/Dirac/CMakeFiles/rtr_solve_robust.dir/all] Error 2
make: *** [all] Error 2
tammojan commented 6 years ago

Just checked, this still happens on the current master and dev branch on my Mac. The master builds fine with CMake on centos7 (CEP3 cluster, with custom built cmake).

fdiblen commented 6 years ago

@tammojan Could you please checkout the dev branch and check if you still have some issues? Thanks!

fdiblen commented 5 years ago

No response from the user. Closing the issue. Feel free to open it again if you are still facing problems.