hpc4cmb / libconviqt

Spherical harmonic convolution library
Other
4 stars 4 forks source link

Unable to install Libvconviqt on MacOS #11

Open GuillermoPascual opened 2 years ago

GuillermoPascual commented 2 years ago

Hi,

I am trying to install Libconviqt on my MacOS system but I get the next errors when I try to build and install the library:

Making all in levels
Making all in c_utils
make[3]: Nothing to be done for `all'.
Making all in cxxsupport
make[3]: Nothing to be done for `all'.
Making all in libfftpack
make[3]: Nothing to be done for `all'.
Making all in Healpix_cxx
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all-am'.
Making all in src
/bin/sh ../libtool  --tag=CXX   --mode=compile mpic++ -DHAVE_CONFIG_H -I. -I..  -I../levels/c_utils -I../levels/libfftpack -I../levels/cxxsupport -I../levels/Healpix_cxx -I../src  -DUSE_MPI   -O3 -std=gnu++11  -MT conviqt_math.lo -MD -MP -MF .deps/conviqt_math.Tpo -c -o conviqt_math.lo conviqt_math.cpp
libtool: compile:  mpic++ -DHAVE_CONFIG_H -I. -I.. -I../levels/c_utils -I../levels/libfftpack -I../levels/cxxsupport -I../levels/Healpix_cxx -I../src -DUSE_MPI -O3 -std=gnu++11 -MT conviqt_math.lo -MD -MP -MF .deps/conviqt_math.Tpo -c conviqt_math.cpp  -fno-common -DPIC -o .libs/conviqt_math.o
conviqt_math.cpp:709:13: error: use of undeclared identifier 'omp_get_thread_num'
        if (omp_get_thread_num() == 0) {
            ^
conviqt_math.cpp:726:21: error: use of undeclared identifier 'omp_get_thread_num'
                if (omp_get_thread_num() == 0) {
                    ^
conviqt_math.cpp:965:13: error: use of undeclared identifier 'omp_get_thread_num'
        if (omp_get_thread_num() == 0) {
            ^
conviqt_math.cpp:982:21: error: use of undeclared identifier 'omp_get_thread_num'
                if (omp_get_thread_num() == 0) {
                    ^
In file included from conviqt_math.cpp:1:
In file included from ./conviqt.hpp:15:
In file included from ../levels/Healpix_cxx/ls_alm.h:37:
../levels/cxxsupport/ls_arr.h:192:42: warning: field 'stm' is uninitialized when used here [-Wuninitialized]
    explicit arrT(tsize sz) : arr_ref<T>(stm.alloc(sz),sz), own(true) {}
                                         ^
../levels/cxxsupport/ls_arr.h:338:36: note: in instantiation of member function 'levels::arrT<levels::svec<double, 2>, levels::alignAlloc__<levels::svec<double, 2>, 16>>::arrT' requested here
    explicit arr_align(tsize sz) : arrT<T,alignAlloc__<T,align> >(sz) {}
                                   ^
../levels/cxxsupport/ls_wigner.h:174:50: note: in instantiation of member function 'levels::arr_align<levels::svec<double, 2>, 16>::arr_align' requested here
      : wignergen_scalar (lmax_,thetas,epsilon), result2(lmax_+1) {}
                                                 ^
In file included from conviqt_math.cpp:1:
In file included from ./conviqt.hpp:15:
In file included from ../levels/Healpix_cxx/ls_alm.h:37:
../levels/cxxsupport/ls_arr.h:192:42: warning: field 'stm' is uninitialized when used here [-Wuninitialized]
    explicit arrT(tsize sz) : arr_ref<T>(stm.alloc(sz),sz), own(true) {}
                                         ^
../levels/cxxsupport/ls_arr.h:309:30: note: in instantiation of member function 'levels::arrT<levels::xcomplex<float>, levels::normalAlloc__<levels::xcomplex<float>>>::arrT' requested here
    explicit arr(tsize sz) : arrT<T,normalAlloc__<T> >(sz) {}
                             ^
../levels/Healpix_cxx/ls_alm.h:97:32: note: in instantiation of member function 'levels::arr<levels::xcomplex<float>>::arr' requested here
      : Alm_Base(lmax_,mmax_), alm (Num_Alms(lmax,mmax)) {}
                               ^
./conviqt.hpp:40:5: note: in instantiation of member function 'levels::Alm<levels::xcomplex<float>>::Alm' requested here
    beam() { normalized_ = false; }
    ^
In file included from conviqt_math.cpp:1:
In file included from ./conviqt.hpp:15:
In file included from ../levels/Healpix_cxx/ls_alm.h:37:
../levels/cxxsupport/ls_arr.h:195:50: warning: field 'stm' is uninitialized when used here [-Wuninitialized]
    arrT(tsize sz, const T &inival) : arr_ref<T>(stm.alloc(sz),sz), own(true)
                                                 ^
../levels/cxxsupport/ls_arr.h:312:38: note: in instantiation of member function 'levels::arrT<int, levels::normalAlloc__<int>>::arrT' requested here
    arr(tsize sz, const T &inival) : arrT<T,normalAlloc__<T> >(sz,inival) {}
                                     ^
conviqt_math.cpp:288:14: note: in instantiation of member function 'levels::arr<int>::arr' requested here
    arr<int> my_hits(nbin, 0), hits(nbin, 0);
             ^
In file included from conviqt_math.cpp:1:
In file included from ./conviqt.hpp:15:
In file included from ../levels/Healpix_cxx/ls_alm.h:37:
../levels/cxxsupport/ls_arr.h:211:41: warning: field 'stm' is uninitialized when used here [-Wuninitialized]
    arrT (const arrT &orig): arr_ref<T>(stm.alloc(orig.s),orig.s), own(true)
                                        ^
../levels/cxxsupport/ls_arr.h:327:28: note: in instantiation of member function 'levels::arrT<int, levels::normalAlloc__<int>>::arrT' requested here
    arr (const arr &orig): arrT<T,normalAlloc__<T> >(orig) {}
                           ^
conviqt_math.cpp:451:26: note: in instantiation of member function 'levels::arr<int>::arr' requested here
        levels::arr<int> offset2(inOffset);
                         ^
In file included from conviqt_math.cpp:1:
In file included from ./conviqt.hpp:15:
In file included from ../levels/Healpix_cxx/ls_alm.h:37:
../levels/cxxsupport/ls_arr.h:192:42: warning: field 'stm' is uninitialized when used here [-Wuninitialized]
    explicit arrT(tsize sz) : arr_ref<T>(stm.alloc(sz),sz), own(true) {}
                                         ^
../levels/cxxsupport/ls_arr.h:309:30: note: in instantiation of member function 'levels::arrT<double, levels::normalAlloc__<double>>::arrT' requested here
    explicit arr(tsize sz) : arrT<T,normalAlloc__<T> >(sz) {}
                             ^
conviqt_math.cpp:673:25: note: in instantiation of member function 'levels::arr<double>::arr' requested here
    levels::arr<double> rthetas(my_ntheta);
                        ^
In file included from conviqt_math.cpp:1:
In file included from ./conviqt.hpp:15:
In file included from ../levels/Healpix_cxx/ls_alm.h:37:
../levels/cxxsupport/ls_arr.h:192:42: warning: field 'stm' is uninitialized when used here [-Wuninitialized]
    explicit arrT(tsize sz) : arr_ref<T>(stm.alloc(sz),sz), own(true) {}
                                         ^
../levels/cxxsupport/ls_arr.h:309:30: note: in instantiation of member function 'levels::arrT<levels::xcomplex<double>, levels::normalAlloc__<levels::xcomplex<double>>>::arrT' requested here
    explicit arr(tsize sz) : arrT<T,normalAlloc__<T> >(sz) {}
                             ^
../levels/cxxsupport/ls_arr.h:585:44: note: in instantiation of member function 'levels::arr<levels::xcomplex<double>>::arr' requested here
    arr3() : s1(0), s2(0), s3(0), s2s3(0), d(0) {}
                                           ^
conviqt_math.cpp:681:38: note: in instantiation of member function 'levels::arr3<levels::xcomplex<double>>::arr3' requested here
    levels::arr3< xcomplex<double> > my_Cmm1, my_Cmm2, my_tod1, my_tod2;
                                     ^
In file included from conviqt_math.cpp:1:
In file included from ./conviqt.hpp:15:
In file included from ../levels/Healpix_cxx/ls_alm.h:37:
../levels/cxxsupport/ls_arr.h:195:50: warning: field 'stm' is uninitialized when used here [-Wuninitialized]
    arrT(tsize sz, const T &inival) : arr_ref<T>(stm.alloc(sz),sz), own(true)
                                                 ^
../levels/cxxsupport/ls_arr.h:312:38: note: in instantiation of member function 'levels::arrT<levels::xcomplex<double>, levels::normalAlloc__<levels::xcomplex<double>>>::arrT' requested here
    arr(tsize sz, const T &inival) : arrT<T,normalAlloc__<T> >(sz,inival) {}
                                     ^
conviqt_math.cpp:1200:41: note: in instantiation of member function 'levels::arr<levels::xcomplex<double>>::arr' requested here
        levels::arr< xcomplex<double> > Cmsky(nphi, 0);
                                        ^
In file included from conviqt_math.cpp:1:
In file included from ./conviqt.hpp:15:
In file included from ../levels/Healpix_cxx/ls_alm.h:37:
../levels/cxxsupport/ls_arr.h:211:41: warning: field 'stm' is uninitialized when used here [-Wuninitialized]
    arrT (const arrT &orig): arr_ref<T>(stm.alloc(orig.s),orig.s), own(true)
                                        ^
../levels/cxxsupport/ls_arr.h:327:28: note: in instantiation of member function 'levels::arrT<double, levels::normalAlloc__<double>>::arrT' requested here
    arr (const arr &orig): arrT<T,normalAlloc__<T> >(orig) {}
                           ^
conviqt_math.cpp:1298:22: note: in instantiation of member function 'levels::arr<double>::arr' requested here
        itheta0SetUp(outpntarr1, ntod1, NThetaIndex1, itheta0_1,
                     ^
8 warnings and 4 errors generated.
make[2]: *** [conviqt_math.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

It seems like I am missing some package but I am not able to guess which one.

Thanks in advance, Guillermo

keskitalo commented 2 years ago

Hi Guillermo!

It looks like the compiler fails to recognize the OpenMP routine omp_get_thread_num() and the problems pile up from there.

The configure script should find the approriate compiler flags for OpenMP. Seems like that didn't happen in your case. One way to ensure OpenMP support is to pass the appropriate compiler flags like this:

CFLAGS=-fopenmp CXXFLAGS=-fopenmp LDFLAGS=-fopenmp ./configure --prefix=$PREFIX

Cheers,

Reijo

GuillermoPascual commented 2 years ago

Thanks Reijo,

I have seen that gcc in Mac refers to clang and then it doesn't allow -fopenmp flag, I have to use gcc-11 instead. Don't know if that can be the problem, and if it is the case how can I solve it.

Also when I add the flags I get the next error:

checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/Users/pascualg/Downloads/libconviqt-master':
configure: error: C++ compiler cannot create executables
See `config.log' for more details

Best regards, Guillermo

keskitalo commented 2 years ago

You can always look in config.log to see why the compiler fails. Most likely your compiler does not support OpenMP threads. Unfortunately, libconviqt will not compile without them. Your best bet is to install the gcc compiler suite from Macports or homebrew.