I am trying to install godi-batteries using GODI console. I seem to have all dependencies sorted (like Camomile). I get the following error within Godi's interface:
> ocamlfind ocamlopt -shared -linkall -package camomile,num,str -o src/batteries_uni.cmxs src/batteries_uni.cmxa
> + ocamlfind ocamlopt -shared -linkall -package camomile,num,str -o src/batteries_uni.cmxs src/batteries_uni.cmxa
> ld: warning: -read_only_relocs cannot be used with x86_64
> ld: codegen problem, can't use rel32 to external symbol _caml_negf_mask in .L101 from src/batteries_uni.a(batFloat.o)
> collect2: ld returned 1 exit status
> File "caml_startup", line 1, characters 0-1:
> Error: Error during linking
> Command exited with code 2.
> make[7]: *** [all] Error 10
> Error: Exec error: File /Users/surikator/godi/build/godi/godi-batteries/./../../mk/bsd.pkg.mk, line 1039: Command returned with non-zero exit code
> Error: Exec error: File /Users/surikator/godi/build/godi/godi-batteries/./../../mk/bsd.pkg.mk, line 1378: Command returned with non-zero exit code
I'm using Mac OS X 10.6.4. and I have a 64 bit machine.
Any ideas on how to go around this?
Thanks,
Surikator.
For some reason, OSX OCaml can't build shared libraries. You'll have to disable batteries' building of shared libraries with
BATTERIES_NATIVE_SHLIB=no make
This problem has been fixed in git commit 92b323, and will be included in the next release.
Related
Running
nix-shell -p agda
on macOS M1 (Monterey), compilation seems to run fine but linking fails with a segmentation error
clang-11: error: linker command failed with exit code 139 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 139)
error: builder for '/nix/store/0zli7b0k7mdq3aj9yrfk546vr1a1mb34-Agda-2.6.2.2.drv' failed with exit code 1;
last 10 log lines:
> [399 of 401] Compiling Agda.Compiler.JS.Compiler ( src/full/Agda/Compiler/JS/Compiler.hs, dist/build/Agda/Compiler/JS/Compiler.o, dist/build/Agda/Compiler/JS/Compiler.dyn_o )
> [400 of 401] Compiling Agda.Compiler.Builtin ( src/full/Agda/Compiler/Builtin.hs, dist/build/Agda/Compiler/Builtin.o, dist/build/Agda/Compiler/Builtin.dyn_o )
> [401 of 401] Compiling Agda.Main ( src/full/Agda/Main.hs, dist/build/Agda/Main.o, dist/build/Agda/Main.dyn_o )
> Preprocessing executable 'agda' for Agda-2.6.2.2..
> Building executable 'agda' for Agda-2.6.2.2..
> [1 of 1] Compiling Main ( src/main/Main.hs, dist/build/agda/agda-tmp/Main.o )
> Linking dist/build/agda/agda ...
> /nix/store/l1vm9w0y2fdav63xk2nfrwgzrg30hm5x-clang-wrapper-11.1.0/bin/ld: line 256: 1241 Segmentation fault: 11 /nix/store/gwm9iadcyybh7gc4q6djvaz4fb40i90c-cctools-binutils-darwin-949.0.1/bin/ld ${extraBefore+"${extraBefore[#]}"} ${params+"${params[#]}"} ${extraAfter+"${extraAfter[#]}"}
> clang-11: error: linker command failed with exit code 139 (use -v to see invocation)
> `cc' failed in phase `Linker'. (Exit code: 139)
I did run into linking issues with other Haskell packages in recent versions of macOS, where ghc couldn't find libffi or zlib, and I had to set env variables, eg
export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"¬
However, In the case of agda, from the error message it's not obvious to me what the issue is: is it caused by a C lib that the linker cannot locate, and if yes how can i discover which one? is it a problem with M1? is nix-shell -p agda suppose to work on M1?
I've finally managed to find a github issue tracking the problem (it wasn't that easy to find): https://github.com/NixOS/nixpkgs/issues/149692#issuecomment-1177684790
According to the ticket, the only available workaround at the moment is to compile for x86_64 and use Rosetta
When I try to build a golang plugin on macOS Catalina using go 1.13.4, the build process breaks with the following error:
$ make buildPlugin
env GOOS=linux go build -buildmode=plugin -o bin/common common/*.go
# command-line-arguments
/usr/local/Cellar/go/1.13.4/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: unknown option: -z
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [buildPlugin] Error 2
✘ $ go tool cgo -V
cgo version go1.13.4
Removing env GOOS=linux helps but it is not a solution. Any ideas about the reason for this problem?
I compiled my makefile for my C++ program on my Mac and it compiled just fine. I tried doing the same thing on my Linux machine with the exact same files and got:
/usr/bin/ld: cannot find -lc++abi
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [allocate-asan] Error 1
I do not know how I can go about compiling this on my linux machine with this error. Any ideas?
I've been trying to compile truecrypt 7.1a on Debian Jessie 8.1.0 AMD64 for the past two days now. I have wxGTK2.8.12 source because Debian Jessie only have v3.0 packages. That's a problem because wxwidgets3.0 has protected wxstandardpaths so you have to use wxstandardpaths::get and truecrypt uses wxstandardpaths in application.cpp for example and it would return an error while compiling.
I'm not sure how to fix that so I went to option 2 compile wxgtk2.8.12 source using the truecrypt compile option # make WX_ROOT=/usr/src/truecrypt-7.1a-source/wxGTK-2.8.12 wxbuild. That completes then I do # make WXSTATIC=1 and I run into this error below. Even if I compile and install wxwidgets-2.8.12 myself I get this error. Maybe it's a x11lib issue?
^
Linking truecrypt
/usr/bin/ld:
/usr/src/truecrypt-7.1a-source/wxrelease/lib/libwx_gtk2u_core-2.8.a(corelib_utilsx11.o): undefined reference to symbol 'XGetWindowAttributes'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO
missing from command line collect2: error: ld returned 1 exit status
Main.make:107: recipe for target 'truecrypt' failed make[1]: ***
[truecrypt] Error 1 Makefile:268: recipe for target 'all' failed make:
*** [all] Error 2
I am trying to install MultiNest on my desktop running Enterprise Red Hat 6.6 (Santiago). I downloaded the necessary package (MultiNest_v3.9_CMake.tar.gz), and followed the installation instructions:
cd MultiNest/build
cmake ..
Although BLAS and LAPACK are installed, I get the following errors:
CMake Error at /usr/share/cmake/Modules/FindBLAS.cmake:594 (message):
A required library with BLAS API not found. Please specify library
location.
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindLAPACK.cmake:142 (find_package)
src/CMakeLists.txt:31 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
See also "/home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeOutput.log".
See also "/home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeError.log".
Any suggestions?
The output "CmakeError.log" is below, and seems to indicate that the problem instead involves something called "pthreads".
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTryCompileExec4203479411/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec4203479411.dir/build.make CMakeFiles/cmTryCompileExec4203479411.dir/build
gmake[1]: Entering directory /home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp'
/usr/local/bin/cmake -E cmake_progress_report /home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec4203479411.dir/CheckSymbolExists.c.o
/usr/local/Ureka/python/bin/gcc -o CMakeFiles/cmTryCompileExec4203479411.dir/CheckSymbolExists.c.o -c /home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec4203479411
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec4203479411.dir/link.txt --verbose=1
/usr/local/Ureka/python/bin/gcc CMakeFiles/cmTryCompileExec4203479411.dir/CheckSymbolExists.c.o -o cmTryCompileExec4203479411 -rdynamic
CMakeFiles/cmTryCompileExec4203479411.dir/CheckSymbolExists.c.o: In functionmain':
CheckSymbolExists.c:(.text+0xc): undefined reference to pthread_create'
collect2: ld returned 1 exit status
gmake[1]: Leaving directory/home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp'
gmake[1]: * [cmTryCompileExec4203479411] Error 1
gmake: * [cmTryCompileExec4203479411/fast] Error 2
File /home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
include
int main(int argc, char** argv)
{
(void)argv;
ifndef pthread_create
return ((int*)(&pthread_create))[argc];
else
(void)argc;
return 0;
endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTryCompileExec3959414027/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3959414027.dir/build.make CMakeFiles/cmTryCompileExec3959414027.dir/build
gmake[1]: Entering directory /home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp'
/usr/local/bin/cmake -E cmake_progress_report /home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3959414027.dir/CheckFunctionExists.c.o
/usr/local/Ureka/python/bin/gcc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3959414027.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake-3.1/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec3959414027
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3959414027.dir/link.txt --verbose=1
/usr/local/Ureka/python/bin/gcc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3959414027.dir/CheckFunctionExists.c.o -o cmTryCompileExec3959414027 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: ld returned 1 exit status
gmake[1]: Leaving directory/home/ianc/Downloads/MultiNest/build/CMakeFiles/CMakeTmp'
gmake[1]: * [cmTryCompileExec3959414027] Error 1
gmake: * [cmTryCompileExec3959414027/fast] Error 2
Install these libraries and their devel versions for the build headers
libblas{3,-dev} liblapack{3,-dev} libatlas{3-base,-dev} cmake build-essential gfortran
You can also try installing compat packages.
The error above indicates that the POSIX threading library, libpthreads, cannot be found on your system. This error originates from your system-provided FindLAPACK.cmake script rather than from something in the MultiNest package.
I don't know the specific library which provides this on RedHat, but you should be able to check using yum provides pthread. After this you can install it using yum install M where M is whatever library provides libpthread from the previous command.