Cannot find mkl when running make - makefile

I am trying to run make on code I've downloaded from the internet (I am on MacOS 10.15.7). I get a bunch of issues like
mkl -O3 -no-prec-div -fpp -qopenmp -xHost -DMPI -module ReleaseMPI -IReleaseMPI/ -c constants.f90 -o ReleaseMPI/constants.o
make[2]: mkl: No such file or directory
make[2]: [ReleaseMPI/constants.o] Error 1 (ignored)
and then at the end,
ar: creating archive ReleaseMPI/libcamb_recfast.a
ar: ReleaseMPI/constants.o: No such file or directory
ar: ReleaseMPI/utils.o: No such file or directory
ar: ReleaseMPI/subroutines.o: No such file or directory
ar: ReleaseMPI/inifile.o: No such file or directory
ar: ReleaseMPI/power_tilt.o: No such file or directory
ar: ReleaseMPI/recfast.o: No such file or directory
ar: ReleaseMPI/reionization.o: No such file or directory
ar: ReleaseMPI/modules.o: No such file or directory
ar: ReleaseMPI/bessels.o: No such file or directory
ar: ReleaseMPI/equations_ppf.o: No such file or directory
ar: ReleaseMPI/halofit_ppf.o: No such file or directory
ar: ReleaseMPI/lensing.o: No such file or directory
ar: ReleaseMPI/SeparableBispectrum.o: No such file or directory
ar: ReleaseMPI/cmbmain.o: No such file or directory
ar: ReleaseMPI/camb.o: No such file or directory
make[2]: *** [ReleaseMPI/libcamb_recfast.a] Error 1
make[1]: *** [camb] Error 2
make: *** [cosmomc] Error 2
I don't know how to ensure mkl is found when running make. echo $MKLROOT gives
/opt/intel/compilers_and_libraries_2018.1.126/mac/mkl

Related

Errors wihen buildng NetCDF: 'cd: IR/grib2/lib: No such file or directory'

I tried to installing netcdf-4.1.3. After configuring the netcdf-4.1.3 file, i had errors with my 'make' command. The error message is below
ameyaw_prince#Mytoses-ThinkPad-T430:~/Build_WRF/LIBRARIES/netcdf-4.1.3$ make
make all-recursive
make[1]: Entering directory '/home/ameyaw_prince/Build_WRF/LIBRARIES/netcdf-4.1.3'
Making all in include
make[2]: Entering directory '/home/ameyaw_prince/Build_WRF/LIBRARIES/netcdf-4.1.3/include'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/ameyaw_prince/Build_WRF/LIBRARIES/netcdf-4.1.3/include'
Making all in libdispatch
make[2]: Entering directory '/home/ameyaw_prince/Build_WRF/LIBRARIES/netcdf-4.1.3/libdispatch'
/bin/bash ../libtool --tag=CC --mode=link /usr/bin/gcc -g -O2 -LIR/grib2/lib -o libdispatch.la libdispatch_la-parallel.lo libdispatch_la-copy.lo libdispatch_la-file.lo libdispatch_la-dim.lo libdispatch_la-att.lo libdispatch_la-error.lo libdispatch_la-var.lo libdispatch_la-dispatch.lo libdispatch_la-nc_uri.lo libdispatch_la-nclist.lo libdispatch_la-ncbytes.lo libdispatch_la-nchashmap.lo libdispatch_la-nclog.lo -lm -lcurl
../libtool: line 5992: cd: IR/grib2/lib: No such file or directory
libtool: link: cannot determine absolute directory name of `IR/grib2/lib'
make[2]: *** [Makefile:328: libdispatch.la] Error 1
make[2]: Leaving directory '/home/ameyaw_prince/Build_WRF/LIBRARIES/netcdf-4.1.3/libdispatch'
make[1]: *** [Makefile:551: all-recursive] Error 1
make[1]: Leaving directory '/home/ameyaw_prince/Build_WRF/LIBRARIES/netcdf-4.1.3'
make: *** [Makefile:422: all] Error 2

Problem in configuring OpenMPI-4.1.1 in Linux

I am trying to configure and install OpenMPI-4.1.1 in a Linux system.
I tried the following command first to configure:
./configure --prefix=/usr/local
The last output lines are:
..........
Mellanox MXM: no
Open UCX: no
OpenFabrics OFI Libfabric: no
OpenFabrics Verbs: yes
Portals4: no
Shared memory/copy in+copy out: yes
Shared memory/Linux CMA: yes
Shared memory/Linux KNEM: no
Shared memory/XPMEM: no
TCP: yes
Resource Managers
-----------------------
Cray Alps: no
Grid Engine: yes
LSF: no
Moab: no
Slurm: yes
ssh/rsh: yes
Torque: no
OMPIO File Systems
-----------------------
DDN Infinite Memory Engine: no
Generic Unix FS: yes
IBM Spectrum Scale/GPFS: no
Lustre: no
PVFS2/OrangeFS: no
Then I tried the following command to install:
make all install
The output result is:
cd . && /bin/sh /home/ratheesh/openmpi-4.1.1/config/missing automake-1.15 --foreign
/home/ratheesh/openmpi-4.1.1/config/missing: line 81: automake-1.15: command not found
WARNING: 'automake-1.15' is missing on your system.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [Makefile.in] Error 1
How to fix this issue?
You have to do reconfigure, This usually happens in TAR archive files, I had the same problem.
Following is the command, in the extracted tarball path simply do:
autoreconf -fiv
then:
./configure --prefix=where/is/the/installation/path
then simply make and make install it:
make && make install
Surely if you do parallelization you would spend less time, for example:
make -j8 && make install
Followed all the suggestions.
Extracted the OpenMPI tar file using tar -xvf openmpi-4.1.1.tar.gz
autoreconf -fiv
./configure --prefix=/home/ratheesh/openmpi-4.1.1
Make and install using make && make install but it gives
Making all in config
make[1]: Entering directory /home/ratheesh/openmpi-4.1.1/config' make[1]: Nothing to be done for all'.
make[1]: Leaving directory /home/ratheesh/openmpi-4.1.1/config' Making all in contrib make[1]: Entering directory /home/ratheesh/openmpi-4.1.1/contrib'
make[1]: Nothing to be done for all'. make[1]: Leaving directory /home/ratheesh/openmpi-4.1.1/contrib'
Making all in opal
make[1]: Entering directory /home/ratheesh/openmpi-4.1.1/opal' Making all in include make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/include'
make all-am
make[3]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/include' make[3]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/include'
make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/include' Making all in datatype make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/datatype'
CC libdatatype_reliable_la-opal_datatype_pack.lo
CC libdatatype_reliable_la-opal_datatype_unpack.lo
CCLD libdatatype_reliable.la
CC opal_convertor.lo
CC opal_convertor_raw.lo
CC opal_copy_functions.lo
CC opal_copy_functions_heterogeneous.lo
CC opal_datatype_add.lo
CC opal_datatype_clone.lo
CC opal_datatype_copy.lo
CC opal_datatype_create.lo
CC opal_datatype_create_contiguous.lo
CC opal_datatype_destroy.lo
CC opal_datatype_dump.lo
CC opal_datatype_fake_stack.lo
CC opal_datatype_get_count.lo
CC opal_datatype_module.lo
CC opal_datatype_monotonic.lo
CC opal_datatype_optimize.lo
CC opal_datatype_pack.lo
CC opal_datatype_position.lo
CC opal_datatype_resize.lo
CC opal_datatype_unpack.lo
CCLD libdatatype.la
make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/datatype' Making all in etc make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/etc'
make[2]: Nothing to be done for all'. make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/etc'
Making all in util
make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/util' Making all in keyval make[3]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/util/keyval'
CC keyval_lex.lo
CCLD libopalutilkeyval.la
make[3]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/util/keyval' make[3]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/util'
CC alfg.lo
CC arch.lo
CC argv.lo
CC basename.lo
CC bipartite_graph.lo
CC cmd_line.lo
CC crc.lo
CC daemon_init.lo
CC ethtool.lo
CC error.lo
CC fd.lo
CC few.lo
CC if.lo
CC keyval_parse.lo
CC malloc.lo
CC net.lo
CC numtostr.lo
CC opal_environ.lo
CC opal_getcwd.lo
CC opal_pty.lo
CC os_dirpath.lo
CC os_path.lo
CC output.lo
CC path.lo
CC printf.lo
CC proc.lo
CC qsort.lo
CC show_help.lo
CC show_help_lex.lo
CC stacktrace.lo
CC strncpy.lo
CC sys_limits.lo
CC uri.lo
CC info_subscriber.lo
CC info.lo
CCLD libopalutil.la
make[3]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/util' make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/util'
Making all in mca/base
make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/mca/base' CC mca_base_close.lo CC mca_base_cmd_line.lo CC mca_base_component_compare.lo CC mca_base_component_find.lo CC mca_base_component_repository.lo CC mca_base_components_open.lo CC mca_base_components_close.lo CC mca_base_components_select.lo CC mca_base_list.lo CC mca_base_open.lo CC mca_base_var.lo CC mca_base_pvar.lo CC mca_base_var_enum.lo CC mca_base_var_group.lo CC mca_base_parse_paramfile.lo CC mca_base_components_register.lo CC mca_base_framework.lo CCLD libmca_base.la make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/mca/base'
Making all in mca/common
make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/mca/common' make[2]: Nothing to be done for all'.
make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/mca/common' Making all in mca/allocator make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/mca/allocator'
CC base/allocator_base_frame.lo
CCLD libmca_allocator.la
make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/mca/allocator' Making all in mca/backtrace make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/mca/backtrace'
CC base/backtrace_component.lo
CCLD libmca_backtrace.la
make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/mca/backtrace' Making all in mca/btl make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/mca/btl'
CC base/btl_base_frame.lo
CC base/btl_base_error.lo
CC base/btl_base_select.lo
CC base/btl_base_mca.lo
CCLD libmca_btl.la
make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/mca/btl' Making all in mca/compress make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/mca/compress'
CC base/compress_base_open.lo
CC base/compress_base_close.lo
CC base/compress_base_select.lo
CC base/compress_base_fns.lo
CCLD libmca_compress.la
make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/mca/compress' Making all in mca/crs make[2]: Entering directory /home/ratheesh/openmpi-4.1.1/opal/mca/crs'
CC base/crs_base_open.lo
CC base/crs_base_close.lo
CC base/crs_base_select.lo
CC base/crs_base_fns.lo
CCLD libmca_crs.la
GENERATE opal_crs.7
Option package-version requires an argument
Usage: ../../../config/make_manpage.pl --package-name= --package-version= --ompi-date= --opal-date= --orte-date= --input= --output= [--nocxx] [ --nofortran] [--nof08]
make[2]: *** [opal_crs.7] Error 1
make[2]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal/mca/crs' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /home/ratheesh/openmpi-4.1.1/opal'
make: *** [all-recursive] Error 1
How to fix this issue?

lack of the file (cholrl.a) during make

I install Lapack-3.6.1 on Ubutun.There is a problem during make, lack of the file (cholrl.a). The error message is this.
make[1]: Leaving directory '/usr/local/src/lapack-3.6.1/BLAS/SRC' ( cd
SRC/VARIANTS ; make) make[1]: Entering directory
'/usr/local/src/lapack-3.6.1/SRC/VARIANTS' gfortran -O2 -frecursive
-c cholesky/RL/cpotrf.f -o cholesky/RL/cpotrf.o gfortran -O2 -frecursive -c cholesky/RL/dpotrf.f -o cholesky/RL/dpotrf.o gfortran -O2 -frecursive -c cholesky/RL/spotrf.f -o cholesky/RL/spotrf.o gfortran -O2 -frecursive -c cholesky/RL/zpotrf.f -o
cholesky/RL/zpotrf.o ar cr LIB/cholrl.a cholesky/RL/cpotrf.o
cholesky/RL/dpotrf.o cholesky/RL/spotrf.o cholesky/RL/zpotrf.o ar:
LIB/cholrl.a: No such file or directory Makefile:38: recipe for target
'cholrl' failed make[1]: * [cholrl] Error 1 make[1]: Leaving
directory '/usr/local/src/lapack-3.6.1/SRC/VARIANTS' Makefile:39:
recipe for target 'variants' failed make: * [variants] Error 2
Do you have a solution?
Creating LIB directory myself worked for me. So, type mkdir LIB in SRC/VARIANTS.

(Cygwin - make) file not recognized: File format not recognized collect2: ld returned 1 exit status

I'm using Cygwin (in windows 7) to emulate Linux terminal, however, when I execute "make" to one of the files, I get the following error, (please note that this worked in Linux terminal)
cd ./agents/randomAgentJava/ && make
make[1]: Entering directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/randomAgentJava'
javac -source 5 -d bin -cp ../../system/libraries/RLVizLib.jar src/RandomAgent/RandomAgent.java
warning: [options] bootstrap class path not set in conjunction with -source 1.5
1 warning
make[1]: Leaving directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/randomAgentJava'
cd ./agents/randomAgentCPP/ && make
make[1]: Entering directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/randomAgentCPP'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/randomAgentCPP'
cd ./agents/mountainCarAgentCPP/ && make
make[1]: Entering directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/mountainCarAgentCPP'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/mountainCarAgentCPP'
cd ./agents/realTimeStrategyAgentJava/ && make
make[1]: Entering directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/realTimeStrategyAgentJava'
javac src/**/*.java -d bin -cp ../../system/libraries/RLVizLib.jar
make[1]: Leaving directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/realTimeStrategyAgentJava'
cd ./agents/helicopterAgentCPP/ && make
make[1]: Entering directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/helicopterAgentCPP'
g++ -c -I../../system/RL-Glue/RL-Glue -I../../system/RL-Glue/Utils -I./src src/weak_baseline_controller.cpp -o bin/weak_baseline_controller.o
g++ -o ./bin/RL_agent bin/weak_baseline_controller.o bin/Glue_utilities.o bin/RL_client_agent.o bin/RL_network.o -lm
bin/Glue_utilities.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Makefile:25: recipe for target `bin/RL_agent' failed
make[1]: *** [bin/RL_agent] Error 1
make[1]: Leaving directory `/cygdrive/f/Linux Files/Helicopter_Control/rl-competition/agents/helicopterAgentCPP'
Makefile:13: recipe for target `all' failed
make: *** [all] Error 2
Thanks in advance!

CMake linking shared library - cannot find lOgreMain

I have built myself Ogre3D http://ogre3d.org binaries and now I want to link to them my project in Qt ( I am using CMake as my build tool ). This is my CMakeLists.txt file :
project(ogre_face_test)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
include_directories( "/home/XXX/programming/SDKs/OGRE_1.8.1_BUILD/include" "." )
link_directories("/home/XXX/programming/SDKs/OGRE_1.8.1_BUILD/lib")
target_link_libraries( ogre_face_test "OgreMain" )
In .../BUILD/lib directory I have files like : libOgreMain.so, libOgreMain.so.1.8.1 and so on.
I am getting this error on linking in Qt Creator :
/usr/bin/cmake -H/home/XXX/programming/c++/ogre_face_sample/ogre_face_test -B/home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build/CMakeFiles /home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build'
make -f CMakeFiles/ogre_face_test.dir/build.make CMakeFiles/ogre_face_test.dir/depend
make[2]: Entering directory `/home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build'
cd /home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/XXX/programming/c++/ogre_face_sample/ogre_face_test /home/XXX/programming/c++/ogre_face_sample/ogre_face_test /home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build /home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build /home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build/CMakeFiles/ogre_face_test.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build'
make -f CMakeFiles/ogre_face_test.dir/build.make CMakeFiles/ogre_face_test.dir/build
make[2]: Entering directory `/home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build'
Linking CXX executable ogre_face_test
/usr/bin/cmake -E cmake_link_script CMakeFiles/ogre_face_test.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/ogre_face_test.dir/main.cpp.o CMakeFiles/ogre_face_test.dir/FacialAnimation.cpp.o -o ogre_face_test -rdynamic -lOgreMain
/usr/bin/ld: cannot find -lOgreMain
collect2: error: ld returned 1 exit status
make[2]: *** [ogre_face_test] Error 1
make[2]: Leaving directory `/home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build'
make[1]: *** [CMakeFiles/ogre_face_test.dir/all] Error 2
make[1]: Leaving directory `/home/XXX/programming/c++/ogre_face_sample/ogre_face_test-build'
make: *** [all] Error 2
EDIT
On the other hand if I use qmake instead of CMake with this file :
TARGET = qt_test_1
TEMPLATE = app
SOURCES += main.cpp\
FacialAnimation.cpp
HEADERS += FacialAnimation.h
INCLUDEPATH += /usr/include\
/home/monkey/programming/SDKs/OGRE_1.8.1_BUILD/include
DEPENDPATH += /usr/include
LIBS += -L/home/monkey/programming/SDKs/OGRE_1.8.1_BUILD/lib -lOgreMain
it links fine.
The CMake documentation says:
link_directories: Specify directories in which the linker will look for libraries.
link_directories(directory1 directory2 ...)
Specify the paths in which the linker should search for libraries. The command will apply only to targets created after it is called. For historical reasons, relative paths given to this command are passed to the linker unchanged (unlike many CMake commands which interpret them relative to the current source directory).
(emphasis mine) So you have to set the directories up before you call the add_executable.

Resources