exception Dl.DL_error : undefined symbol: SDL_GetError - binding

So, I wanted to use Tsdl and here's what I did :
I couldn't find SDL 2.0.5 with apt-get so I downloaded it, ./configure && make && sudo make install
opam install tsdl
Then I created a file main.ml (given as an example on tsdl website) :
open Tsdl
open Result
let main () = match Sdl.init Sdl.Init.video with
| Error (`Msg e) -> Sdl.log "Init error: %s" e; exit 1
| Ok () ->
match Sdl.create_window ~w:640 ~h:480 "SDL OpenGL" Sdl.Window.opengl with
| Error (`Msg e) -> Sdl.log "Create window error: %s" e; exit 1
| Ok w ->
Sdl.delay 3000l;
Sdl.destroy_window w;
Sdl.quit ();
exit 0
let () = main ()
ocamlfind ocamlopt -package tsdl -linkpkg -o main.native main.ml
It works and now comes my problem :
./main.native
Fatal error: exception Dl.DL_error("./main.native: undefined symbol: SDL_GetError")
Did I do something wrong or do I need to tell explicitly where my SDL2 lib is or something else ?
Update :
> ocamlobjinfo $(opam config var tsdl:lib)/tsdl.cmxa | grep Extra
Extra C object files: -L/usr/local/lib -Wl,-rpath,/usr/local/lib -Wl,--enable-new-dtags -lSDL2 -ltsdl
Extra C options:
> sdl2-config --libs
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -Wl,--enable-new-dtags -lSDL2
Update 2 :
> ldd ./main.native
linux-vdso.so.1 => (0x00007fff1f4c1000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f4aff55e000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4aff255000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4aff050000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4afec87000)
/lib64/ld-linux-x86-64.so.2 (0x000055dc05e17000)
Update 3
lhooq#lhooq ~/tsdl $ ocamlfind ocamlopt -cclib -lSDL2 -package tsdl -linkpkg -o min.native min.ml -verbose
Effective set of compiler predicates: pkg_result,pkg_unix,pkg_bigarray,pkg_str,pkg_bytes,pkg_ctypes,pkg_ctypes.foreign.base,pkg_ctypes.foreign.unthreaded,pkg_ctypes.foreign,pkg_tsdl,autolink,native
+ ocamlopt.opt -o min.native -verbose -I /home/lhooq/.opam/4.04.0/lib/result -I /home/lhooq/.opam/4.04.0/lib/bytes -I /home/lhooq/.opam/4.04.0/lib/ctypes -I /home/lhooq/.opam/4.04.0/lib/tsdl /home/lhooq/.opam/4.04.0/lib/result/result.cmxa /home/lhooq/.opam/4.04.0/lib/ocaml/unix.cmxa /home/lhooq/.opam/4.04.0/lib/ocaml/bigarray.cmxa /home/lhooq/.opam/4.04.0/lib/ocaml/str.cmxa /home/lhooq/.opam/4.04.0/lib/ctypes/ctypes.cmxa /home/lhooq/.opam/4.04.0/lib/ctypes/ctypes-foreign-base.cmxa /home/lhooq/.opam/4.04.0/lib/ctypes/ctypes-foreign-unthreaded.cmxa /home/lhooq/.opam/4.04.0/lib/tsdl/tsdl.cmxa -cclib -lSDL2 min.ml
+ as -o 'min.o' '/tmp/camlasm9ab424.s'
+ as -o '/tmp/camlstartupe796c9.o' '/tmp/camlstartup4a1081.s'
+ gcc -o 'min.native' '-L/home/lhooq/.opam/4.04.0/lib/result' '-L/home/lhooq/.opam/4.04.0/lib/bytes' '-L/home/lhooq/.opam/4.04.0/lib/ctypes' '-L/home/lhooq/.opam/4.04.0/lib/tsdl' '-L/home/lhooq/.opam/4.04.0/lib/ocaml' '/tmp/camlstartupe796c9.o' '/home/lhooq/.opam/4.04.0/lib/ocaml/std_exit.o' 'min.o' '/home/lhooq/.opam/4.04.0/lib/tsdl/tsdl.a' '/home/lhooq/.opam/4.04.0/lib/ctypes/ctypes-foreign-unthreaded.a' '/home/lhooq/.opam/4.04.0/lib/ctypes/ctypes-foreign-base.a' '/home/lhooq/.opam/4.04.0/lib/ctypes/ctypes.a' '/home/lhooq/.opam/4.04.0/lib/ocaml/str.a' '/home/lhooq/.opam/4.04.0/lib/ocaml/bigarray.a' '/home/lhooq/.opam/4.04.0/lib/ocaml/unix.a' '/home/lhooq/.opam/4.04.0/lib/result/result.a' '/home/lhooq/.opam/4.04.0/lib/ocaml/stdlib.a' '-L/usr/local/lib' '-Wl,-rpath,/usr/local/lib' '-Wl,--enable-new-dtags' '-lSDL2' '-ltsdl' '-Wl,--no-as-needed' '-lffi' '-lctypes-foreign-base_stubs' '-Wl,--no-as-needed' '-lffi' '-lctypes_stubs' '-Wl,--no-as-needed' '-lcamlstr' '-lbigarray' '-lunix' '-lSDL2' '/home/lhooq/.opam/4.04.0/lib/ocaml/libasmrun.a' -lm -ldl
lhooq#lhooq ~/tsdl $ ocamlfind ocamlopt -package tsdl -linkpkg -o min.native min.ml -verbose
Effective set of compiler predicates: pkg_result,pkg_unix,pkg_bigarray,pkg_str,pkg_bytes,pkg_ctypes,pkg_ctypes.foreign.base,pkg_ctypes.foreign.unthreaded,pkg_ctypes.foreign,pkg_tsdl,autolink,native
+ ocamlopt.opt -o min.native -verbose -I /home/lhooq/.opam/4.04.0/lib/result -I /home/lhooq/.opam/4.04.0/lib/bytes -I /home/lhooq/.opam/4.04.0/lib/ctypes -I /home/lhooq/.opam/4.04.0/lib/tsdl /home/lhooq/.opam/4.04.0/lib/result/result.cmxa /home/lhooq/.opam/4.04.0/lib/ocaml/unix.cmxa /home/lhooq/.opam/4.04.0/lib/ocaml/bigarray.cmxa /home/lhooq/.opam/4.04.0/lib/ocaml/str.cmxa /home/lhooq/.opam/4.04.0/lib/ctypes/ctypes.cmxa /home/lhooq/.opam/4.04.0/lib/ctypes/ctypes-foreign-base.cmxa /home/lhooq/.opam/4.04.0/lib/ctypes/ctypes-foreign-unthreaded.cmxa /home/lhooq/.opam/4.04.0/lib/tsdl/tsdl.cmxa min.ml
+ as -o 'min.o' '/tmp/camlasm201bd8.s'
+ as -o '/tmp/camlstartup7113e2.o' '/tmp/camlstartup4724f2.s'
+ gcc -o 'min.native' '-L/home/lhooq/.opam/4.04.0/lib/result' '-L/home/lhooq/.opam/4.04.0/lib/bytes' '-L/home/lhooq/.opam/4.04.0/lib/ctypes' '-L/home/lhooq/.opam/4.04.0/lib/tsdl' '-L/home/lhooq/.opam/4.04.0/lib/ocaml' '/tmp/camlstartup7113e2.o' '/home/lhooq/.opam/4.04.0/lib/ocaml/std_exit.o' 'min.o' '/home/lhooq/.opam/4.04.0/lib/tsdl/tsdl.a' '/home/lhooq/.opam/4.04.0/lib/ctypes/ctypes-foreign-unthreaded.a' '/home/lhooq/.opam/4.04.0/lib/ctypes/ctypes-foreign-base.a' '/home/lhooq/.opam/4.04.0/lib/ctypes/ctypes.a' '/home/lhooq/.opam/4.04.0/lib/ocaml/str.a' '/home/lhooq/.opam/4.04.0/lib/ocaml/bigarray.a' '/home/lhooq/.opam/4.04.0/lib/ocaml/unix.a' '/home/lhooq/.opam/4.04.0/lib/result/result.a' '/home/lhooq/.opam/4.04.0/lib/ocaml/stdlib.a' '-L/usr/local/lib' '-Wl,-rpath,/usr/local/lib' '-Wl,--enable-new-dtags' '-lSDL2' '-ltsdl' '-Wl,--no-as-needed' '-lffi' '-lctypes-foreign-base_stubs' '-Wl,--no-as-needed' '-lffi' '-lctypes_stubs' '-Wl,--no-as-needed' '-lcamlstr' '-lbigarray' '-lunix' '/home/lhooq/.opam/4.04.0/lib/ocaml/libasmrun.a' -lm -ldl

This appears to be a minor issue in tsdl, see this for more information: https://github.com/dbuenzli/tsdl/issues/38
It is fixed in master. As the author suggests you can (for now) do this as a temporary fix:
opam pin add tsdl --dev
EDIT: as indicated by #dbuenzli below this is fixed in 0.9.4 which is on its way to opam.

Related

How to build open3d from source on l4t-base:r32.5.0 IMG?

I've been trying to build open3d from source on the l4t-base:r32.5.0 IMG from NVIDIA for quite some time now and have basically searched the whole internet for a script/guide, but I can't seem to find anything or get it to work myself.
Following the exact steps stated on http://www.open3d.org/docs/release/arm.html I get the following output while running the following Dockerfile
Dockerfile
FROM dustynv/ros:foxy-ros-base-l4t-r32.5.0
WORKDIR /workspace
##########################
### CMAKE INSTALLATION ###
##########################
RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.6/cmake-3.20.6-linux-aarch64.tar.gz
RUN tar -v -xzf cmake-3.20.6-linux-aarch64.tar.gz
RUN mv cmake-3.20.6-linux-aarch64 cmake
RUN echo "alias cmake='/workspace/cmake/bin/cmake'" >> /root/.bashrc
RUN source /root/.bashrc && cmake --version
#################################
### OPEN3D 0.13.0 INSTALLTION ###
#################################
RUN wget https://github.com/isl-org/Open3D/archive/refs/tags/v0.13.0.tar.gz
RUN tar -v -xzf v0.13.0.tar.gz
RUN mv Open3D-0.13.0 open3d
RUN apt-get update && apt-get install xorg-dev libglu1-mesa-dev -y
RUN cd open3d && mkdir build && cd build && \
/workspace/cmake/bin/cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_CUDA_MODULE=OFF \
-DBUILD_GUI=OFF \
-DBUILD_TENSORFLOW_OPS=OFF \
-DBUILD_PYTORCH_OPS=OFF \
-DBUILD_UNIT_TESTS=ON \
-DCMAKE_INSTALL_PREFIX=~/open3d_install \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
..
ErrorLog
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /workspace/open3d/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_d15b1/fast && /usr/bin/make -f CMakeFiles/cmTC_d15b1.dir/build.make CMakeFiles/cmTC_d15b1.dir/build
make[1]: Entering directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_d15b1.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -fPIE -o CMakeFiles/cmTC_d15b1.dir/src.c.o -c /workspace/open3d/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_d15b1
/workspace/cmake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d15b1.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_d15b1.dir/src.c.o -o cmTC_d15b1
CMakeFiles/cmTC_d15b1.dir/src.c.o: In function `main':
src.c:(.text+0x48): undefined reference to `pthread_create'
src.c:(.text+0x50): undefined reference to `pthread_detach'
src.c:(.text+0x58): undefined reference to `pthread_cancel'
src.c:(.text+0x64): undefined reference to `pthread_join'
src.c:(.text+0x74): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_d15b1.dir/build.make:98: recipe for target 'cmTC_d15b1' failed
make[1]: *** [cmTC_d15b1] Error 1
make[1]: Leaving directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_d15b1/fast' failed
make: *** [cmTC_d15b1/fast] Error 2
Source file was:
#include <pthread.h>
static void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Looking for a ASM_NASM compiler failed with the following output:
-- The ASM_NASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_ASM_NASM_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "ASM_NASM" or the CMake cache entry CMAKE_ASM_NASM_COMPILER to the
full path to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/workspace/open3d/build/CMakeFiles/CheckASM_NASM/CMakeFiles/CMakeOutput.log".
See also "/workspace/open3d/build/CMakeFiles/CheckASM_NASM/CMakeFiles/CMakeError.log".
Determining if the function sgemm_ exists failed with the following output:
Change Dir: /workspace/open3d/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_855e0/fast && /usr/bin/make -f CMakeFiles/cmTC_855e0.dir/build.make CMakeFiles/cmTC_855e0.dir/build
make[1]: Entering directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_855e0.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgemm_ -fPIE -o CMakeFiles/cmTC_855e0.dir/CheckFunctionExists.c.o -c /workspace/cmake/share/cmake-3.20/Modules/CheckFunctionExists.c
Linking C executable cmTC_855e0
/workspace/cmake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_855e0.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgemm_ CMakeFiles/cmTC_855e0.dir/CheckFunctionExists.c.o -o cmTC_855e0
CMakeFiles/cmTC_855e0.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c:(.text+0x10): undefined reference to `sgemm_'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_855e0.dir/build.make:98: recipe for target 'cmTC_855e0' failed
make[1]: *** [cmTC_855e0] Error 1
make[1]: Leaving directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_855e0/fast' failed
make: *** [cmTC_855e0/fast] Error 2
Determining if the function cheev_ exists failed with the following output:
Change Dir: /workspace/open3d/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_3a46a/fast && /usr/bin/make -f CMakeFiles/cmTC_3a46a.dir/build.make CMakeFiles/cmTC_3a46a.dir/build
make[1]: Entering directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3a46a.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=cheev_ -fPIE -o CMakeFiles/cmTC_3a46a.dir/CheckFunctionExists.c.o -c /workspace/cmake/share/cmake-3.20/Modules/CheckFunctionExists.c
Linking C executable cmTC_3a46a
/workspace/cmake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3a46a.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=cheev_ CMakeFiles/cmTC_3a46a.dir/CheckFunctionExists.c.o -o cmTC_3a46a /usr/lib/aarch64-linux-gnu/libblas.so -pthread -lm -ldl
CMakeFiles/cmTC_3a46a.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c:(.text+0x10): undefined reference to `cheev_'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_3a46a.dir/build.make:99: recipe for target 'cmTC_3a46a' failed
make[1]: *** [cmTC_3a46a] Error 1
make[1]: Leaving directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_3a46a/fast' failed
make: *** [cmTC_3a46a/fast] Error 2
Determining if the function LAPACKE_dgeqrf exists failed with the following output:
Change Dir: /workspace/open3d/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_9905d/fast && /usr/bin/make -f CMakeFiles/cmTC_9905d.dir/build.make CMakeFiles/cmTC_9905d.dir/build
make[1]: Entering directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9905d.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=LAPACKE_dgeqrf -fPIE -o CMakeFiles/cmTC_9905d.dir/CheckFunctionExists.c.o -c /workspace/cmake/share/cmake-3.20/Modules/CheckFunctionExists.c
Linking C executable cmTC_9905d
/workspace/cmake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9905d.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=LAPACKE_dgeqrf CMakeFiles/cmTC_9905d.dir/CheckFunctionExists.c.o -o cmTC_9905d /usr/lib/aarch64-linux-gnu/liblapack.so /usr/lib/aarch64-linux-gnu/libblas.so
CMakeFiles/cmTC_9905d.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c:(.text+0x10): undefined reference to `LAPACKE_dgeqrf'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_9905d.dir/build.make:100: recipe for target 'cmTC_9905d' failed
make[1]: *** [cmTC_9905d] Error 1
make[1]: Leaving directory '/workspace/open3d/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_9905d/fast' failed
make: *** [cmTC_9905d/fast] Error 2
Problem:
I want to build open3d from source on an arm docker img with a Dockerfile. More specifically, the l4t-base:r32.5.0 img provided by NVIDIA. This image will be used on a Jetson XavierNX with docker installed.
Above you can see what I have tried so far in terms of Dockerfile and the output this gives me.
What I am asking is, if anyone has a Dockerfile for building open3d from source on an arm based image or knows how to do it successfully, because I cannot seem to be able to do it.

brew: unable to install mumps on mac

I am trying to install ipopt by:
brew install ipopt.rb --with-openblas
and I got the following error:
==> Installing dependencies for ipopt: mumps
==> Installing ipopt dependency: mumps
==> Downloading http://mumps.enseeiht.fr/MUMPS_5.1.1.tar.gz
Already downloaded: /Users/yufeiliu/Library/Caches/Homebrew/mumps-5.1.1.tar.gz
==> make alllib LIBEXT=.dylib AR= -dynamiclib -Wl,-install_name -Wl,/usr/local/Cellar/mumps/5.1.
Last 15 lines from /Users/yufeiliu/Library/Logs/Homebrew/mumps/01.make:
clang -fPIC -I../include -O -c symbfac.c -o symbfac.o
clang -fPIC -I../include -O -c interface.c -o interface.o
clang -fPIC -I../include -O -c sort.c -o sort.o
clang -fPIC -I../include -O -c minpriority.c -o minpriority.o
dynamiclib -Wl,-install_name -Wl,/usr/local/Cellar/mumps/5.1.1_1/lib/libpord.dylib -undefined dynamic_lookup -o libpord.dylib graph.o gbipart.o gbisect.o ddcreate.o ddbisect.o nestdiss.o multisector.o gelim.o bucket.o tree.o symbfac.o interface.o sort.o minpriority.o
make[2]: dynamiclib: No such file or directory
make[2]: [libpord.dylib] Error 1 (ignored)
echo libpord.dylib
libpord.dylib
if [ "./PORD/lib/" != "" ] ; then \
cp ./PORD/lib//libpord.dylib lib/libpord.dylib; \
fi;
cp: ./PORD/lib//libpord.dylib: No such file or directory
make[1]: *** [lib/libpord.dylib] Error 1
make: *** [c] Error 2
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/brewsci/homebrew-science/issues
Does anyone know how to solve this?
Unfortunately installation of mumps package with brew is very problematic at this moment. You have two different ways to install mumps
Method 1:
brew tap brewsci/science
brew install mumps
if that didn't work, download mumps.rb from here
brew install ./mumps.rb
Method 2
brew tap dpo/openblas
brew install mumps
The second method might lead to some issues with scalapack later.
Update: Unfortunately the above method might not work properly anymore. I have updated the installation method here.

Error while building libcrypto and libssl for tvOS

I'm using the following build script
https://gist.github.com/felix-schwarz/c61c0f7d9ab60f53ebb0
to build libcrypto and libssl for tvOS. I have Xcode 7.1 beta (7B75) installed. I updated the line
DEVELOPER=`xcode-select -print-path`
to refer to the Developer folder in Xcode-beta.app. When I run the script, it fails at building the tvOS libraries. When I check the /tmp/....log file it first tells me that -mtvos-min-version=9.0 is an unknown option. When I remove that option from the build script, so that
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -mtvos-version-min=${TVOS_MIN_SDK_VERSION} !" "Makefile"
becomes
sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile"
it does continue to create all the object files, but when it tries to make the library I get this error:
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f ../Makefile.shared -e \
APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o" \
LIBDEPS="-Wl,-search_paths_first $LIBRARIES " \
link_app.${shlib_target}
( :; LIBDEPS="${LIBDEPS:--Wl,-search_paths_first -L.. -lssl -L.. -lcrypto }"; LDCMD="${LDCMD:-/Applications/Xcode-beta.app/Contents/Developer/usr/bin/gcc -fembed-bitcode -arch arm64}"; LDFLAGS="${LDFLAGS:--isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk -fomit-frame-pointer -fno-common}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o ${LIBDEPS} )
clang: error: -fembed-bitcode is not supported on versions of iOS prior to 6.0
make[2]: *** [link_app.] Error 1
make[1]: *** [openssl] Error 2
make: *** [build_apps] Error 1
Any idea what I'm doing wrong?
The make executable was still being called from Xcode 7.0, and not Xcode 7.1 beta. I resolved it by renaming Xcode-beta.app to Xcode.app. Then, when I ran the script, it worked!

compiling with HDF5: unable to link library files (fortran 90)

I am currently try to compile these files using HDF5
I have directly linked and included everything necessary ( I think) but still the compile unable to find the files that is needed
This is my Makefile:
CC = h5cc
FC = h5fc
LD = h5fc
FDEBUG = -std -g -traceback
CFLAGS = -g -O0 -Wall -pedantic
FFLAGS = -g -O0 -Wall -I$(H5DIR)/include -L$(H5DIR)/lib/libhdf5hl_fortran.a
LDFLAGS = -I$(H5DIR)/include -L$(H5DIR)/lib/libhdf5hl_fortran.a
#LDFLAGS = -I$(MKLROOT)/include -L$(MKLROOT) -mkl=sequential
# -opt-block-factor=16 -opt-prefetch=4 \
.SUFFIXES:
.SUFFIXES: .c .f .f90 .F90 .o
OBJS = timing.o \
kinds.o \
rw_matrix.o \
EXE = matmul_omp.exe
all: $(EXE)
$(EXE): $(OBJS) matmul_omp.o
$(LD) $(LDFLAGS) -o $# $^
.f90.o:
-$(RM) -f $*.o $*.mod
$(FC) $(FFLAGS) -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
.PHONEY: clean
clean:
THis is the err:
h5fc -I/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/include -L/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/lib/libhdf5hl_fortran.a -o matmul_omp.exe timing.o matmul_omp.o
gfortran: /usr/lib64/libhdf5hl_fortran.a: No such file or directory
gfortran: /usr/lib64/libhdf5_hl.a: No such file or directory
gfortran: /usr/lib64/libhdf5_fortran.a: No such file or directory
gfortran: /usr/lib64/libhdf5.a: No such file or directory
As you can see that I directly link libhdf5hl_fortran.a. but i dont know why the error is giving a different directory /usr/lib64/
I think you have a couple of things wrong here.
If you are using h5fc then you shouldn't need to add all the include and lib paths. That is the whole point of the helper applications.
You are adding the paths that have Intel, yet your h5fc has a GNU (gfortran) error.
The gfortran build of HDF5 looks as if it does not have the fortran bindings built.
I would suggest trying the following. Using the full paths (as you have done) but call ifort instead of h5fc:
ifort -I/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/include \
-L/curc/tools/x_86_64/rh6/hdf5/1.8.13/szip/2.1/zlib/1.2.8/jpeglib/9a/openmpi/1.8.2/intel/13.0.0/lib/libhdf5hl_fortran.a \
-o matmul_omp.exe timing.o matmul_omp.o

configure script and ldid

The excerpt form the configure scripts fails due to Killed: 9 error, which is that iOS 5 can only run signed apps. So I need to find a way to put ldid -s some where in these tests, only problem is where.
Anyone???
fails with
checking build system compiler gcc... no
checking build system compiler gcc -g -O2 ... no
checking build system compiler cc... no
checking build system compiler gcc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler
and config.log
onfigure:15586: gcc -c -g -O2 conftest.c >&5
configure:15586: $? = 0
configure:15586: result: yes
configure:15586: checking sys/time.h presence
configure:15586: gcc -E conftest.c
configure:15586: $? = 0
configure:15586: result: yes
configure:15586: checking for sys/time.h
configure:15586: result: yes
configure:15677: checking build system compiler gcc
configure:15690: gcc conftest.c
conftest.c: In function 'main':
conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
configure:15693: $? = 0
./configure: line 15675: 27218 Killed: 9 ./a.out
./configure: line 15695: ./b.out: No such file or directory
./configure: line 15695: ./a.exe: No such file or directory
./configure: line 15695: ./a_out.exe: No such file or directory
./configure: line 15695: ./conftest: No such file or directory
configure:15700: result: no
configure:15677: checking build system compiler gcc -g -O2
configure:15690: gcc -g -O2 conftest.c
conftest.c: In function 'main':
conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
configure:15693: $? = 0
./configure: line 15675: 27234 Killed: 9 ./a.out
./configure: line 15695: ./b.out: No such file or directory
./configure: line 15695: ./a.exe: No such file or directory
./configure: line 15695: ./a_out.exe: No such file or directory
./configure: line 15695: ./conftest: No such file or directory
configure:15700: result: no
And finally the ./configure script..
if test -n "$CC_FOR_BUILD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $CC_FOR_BUILD" >&5
$as_echo_n "checking build system compiler $CC_FOR_BUILD... " >&6; }
# remove anything that might look like compiler output to our "||" expression
rm -f conftest* a.out b.out a.exe a_out.exe
cat >conftest.c <<EOF
int
main ()
{
exit(0);
}
EOF
gmp_compile="$CC_FOR_BUILD conftest.c"
cc_for_build_works=no
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
(eval $gmp_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
cc_for_build_works=yes
fi
fi
rm -f conftest* a.out b.out a.exe a_out.exe
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_for_build_works" >&5
$as_echo "$cc_for_build_works" >&6; }
if test "$cc_for_build_works" = yes; then
:
else
as_fn_error $? "Specified CC_FOR_BUILD doesn't seem to work" "$LINENO" 5
fi
elif test -n "$HOST_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $HOST_CC" >&5
$as_echo_n "checking build system compiler $HOST_CC... " >&6; }
# remove anything that might look like compiler output to our "||" expression
rm -f conftest* a.out b.out a.exe a_out.exe
cat >conftest.c <<EOF
int
main ()
{
exit(0);
}
I have to admit that my ability to read anything but the simplest shell scripts is pretty poor, but basically, you need to fake codesign the executable before you run it. It looks like the executable you want to run is called conftest, right? So, try signing it in this block:
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
(eval $gmp_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
#begin added code
ldid -S ./conftest
#end added code
if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
cc_for_build_works=yes
fi
fi
Obviously, you might need to supply the full path to ldid (e.g. /usr/bin/ldid) if it's not found in the existing PATH.
Update: per poster's comment below, a.out is actually the executable that needs to be signed, not conftest.

Resources