I can't get haskell's stack to work on my Mac.
I installed haskell by:
brew cask install haskell-platform
Which is specified here: https://www.haskell.org/platform/mac.html#osx-homebrewcask
I've also tried installing via the downloadable package at the same site.
I do the following commands:
stack new my-project
cd my-project
stack setup
stack build
stack exec my-project-exe
Per the documentation here:
https://docs.haskellstack.org/en/stable/README/#quick-start-guide
And I immediately see this:
[1] 43017 killed stack exec my-project-exe
I've also tried many other ways of installing haskell. I've actually been able to get something compiled and executed just using cabal, but I can't then get hlint, hindent, or ghc-mod to work, they all return a similar message to the one above. I'd love to be able to work with HaskForce in IntelliJ on my Mac, but I've never had luck getting haskell to work.
System Specs
macOS 10.12.6 (16G29) (Sierra)
Fresh uninstall/reinstall of XCode (accepted terms)
brew as package manager
Here's a gif of what happens as well: https://imgur.com/gallery/afYym7m
UPDATE
I blew away all stuff related to ghc, stack, and cabal and then installed this way
https://haskell-lang.org/get-started
Writing the little HelloWorld.hs script worked fine and showed Hello, World
However, doing
stack new someproj
cd someproj
stack build
Resulted in this:
➜ someproj stack build
[1 of 2] Compiling Main ( /Users/trevord2/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /Users/trevord2/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim ( /Users/trevord2/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /Users/trevord2/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /Users/trevord2/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 ...
someproj-0.1.0.0: configure (lib + exe)
Configuring someproj-0.1.0.0...
someproj-0.1.0.0: build (lib + exe)
Preprocessing library someproj-0.1.0.0...
[1 of 1] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Lib.o )
Preprocessing executable 'someproj-exe' for someproj-0.1.0.0...
[1 of 1] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/someproj-exe/someproj-exe-tmp/Main.o )
Linking .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/someproj-exe/someproj-exe ...
ld: warning: ignoring file /Users/trevord2/someproj/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/libHSsomeproj-0.1.0.0-6corWoTDCA69pE1sqNF8Id.a, file was built for archive which is not the architecture being linked (x86_64): /Users/trevord2/someproj/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/libHSsomeproj-0.1.0.0-6corWoTDCA69pE1sqNF8Id.a
Undefined symbols for architecture x86_64:
"_someprojzm0zi1zi0zi0zm6corWoTDCA69pE1sqNF8Id_Lib_someFunc1_closure", referenced from:
_Main_main1_info in Main.o
_S39Z_srt in Main.o
"_someprojzm0zi1zi0zi0zm6corWoTDCA69pE1sqNF8Id_Lib_someFunc1_info", referenced from:
_Main_main_info in Main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
-- While building package someproj-0.1.0.0 using:
/Users/trevord2/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build lib:someproj exe:someproj-exe --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Which I've seen before and was actually one of my initial problems
UPDATE 2: Created GitHub Issue
Here's the issue: https://github.com/commercialhaskell/stack/issues/3487
After talking with folks on #haskell IRC they recommended I create an issue as this is very peculiar behaviour from what I understand. I'll try make sure whatever we find out here is pushed up there too.
Related
I have a Haskell stack project where I have been using the llvm-hs library for building a compiler which emits LLVM IR. I had been working with LLVM version 8.0.0 so far. Recently due to a Python upgrade in my system the LLVM version got bumped to 8.0.1.
When I attempt to do stack build I get the following error -
ld: warning: directory not found for option '-L/usr/local/Cellar/llvm-8/8.0.0/lib/llvm-8/lib'
ld: library not found for -lLLVM-8
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
It seems from the above that ld is looking for -L/usr/local/Cellar/llvm-8/8.0.0/lib/llvm-8/lib whereas on my system I currently have the version for 8.0.1. How do I point ld to the correct path?
I am running MacOS Mojave. stack version 2.3.1. Thanks
I was capable of solving this by adding the following to my .bash_profile
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/Cellar/llvm-8/8.0.1/lib/llvm-8/lib"
Hope this helps if someone ran into the same problem.
I am getting a linking error while compiling opencv with cuda on Mac OS X high Sierra (10.13.6).
Error message:
[ 21%] Linking CXX shared library ../../lib/libopencv_cudev.dylib
ld: warning: directory not found for option '-L/Users/unknownn/opencv/-Wl,-rpath,/usr/local/cuda'
ld: warning: directory not found for option '-L-Wl,-rpath,/usr/local/cuda'
ld: library not found for -llib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libopencv_cudev.4.0.1.dylib] Error 1
make[1]: *** [modules/cudev/CMakeFiles/opencv_cudev.dir/all] Error 2
make: *** [all] Error 2
I have already tried pretty much every cuda (9, 9.2, 10) and opencv (3.4, 4.0.1) version. Also I am aware that every cuda version requires a specific Xcode version.
I have also tried various cmake versions
I checked for the correct cuda paths in ccmake.
I dont know why the ld warnings appear since /usr/local/cuda exist.
What is -llib?
I had the same problem as well, what's interesting is that the problem does not appear to be with OpenCV, but with cmake.
The FindCUDA that comes with cmake seems to be broken, producing that strange -llib. You can see it during the cmake run as well as:
Extra dependencies: cudart_static lib nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cufft -L/usr/local/cuda/lib -L-Wl,-rpath,/usr/local/cuda
(Note the second element "lib", the last two -L... elements will cause problem when you do make install as well)
However, the opencv source package comes with FindCUDA.cmake files that seem to work.
Assuming:
cmake is in /usr/local/share/cmake
opencv source is in ~/opencv
Do the following first:
mv /usr/local/share/cmake/Modules/FindCUDA* /tmp # Or some other back up location
cp -r ~/opencv/cmake/FindCUDA* /usr/local/share/cmake/Modules
Then run your build steps as before (cmake ..., make ..., make install), and hopefully it will work this time (it did for me).
As far as I can tell, cmake has deprecated FindCUDA.cmake, so I'm guessing it won't get fixed any time soon.
Answer by Jack Leow was very usefull, but I had to make farther investigation, because indeed his solution doesn't work any more.
Finally I have found this answer on opencv github by alalek. If in short, he proposes to add following cmake definition:
-DOPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE=ON
This solution works to me.
P.S.: Currently I managed to solve few more issues on my way to get awesome opencv build. But currently build is in progress (44%) hope it will be finished in next half an hour, haha!
sorry, although this workaround worked once with opencv-3.4.9 / XCode8.2 (Clang 8) / CMake 3.12, now the switching of the FindCUDA files does not work anymore with the combination
opencv-3.4.9 / XCode9.2 (Clang 9) / CMake 3.16 with the following error:
CMake Error at /Applications/CMake.app/Contents/share/cmake3.16/Modules/FindCUDA.cmake:416 (file):
file failed to open for writing (Permission denied):
/Users/filippo/opencv- 3.4.9/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_genera ted_gpu_mat.cu.o.depend
Call Stack (most recent call first):
/Applications/CMake.app/Contents/share/cmake-3.16/Modules/FindCUDA.cmake:1363 (cuda_include_nvcc_dependencies)
/Applications/CMake.app/Contents/share/cmake-3.16/Modules/FindCUDA.cmake:1650 (CUDA_WRAP_SRCS)
/Applications/CMake.app/Contents/share/cmake-3.16/Modules/FindCUDA.cmake:1663 (cuda_compile_base)
cmake/OpenCVDetectCUDA.cmake:262 (CUDA_COMPILE)
cmake/OpenCVUtils.cmake:1513 (ocv_cuda_compile)
cmake/OpenCVModule.cmake:927 (ocv_add_library)
cmake/OpenCVModule.cmake:848 (_ocv_create_module)
modules/core/CMakeLists.txt:81 (ocv_create_module)
I had to update XCode to the 9.2 because I had a "nullability" compiling error in the building opencv-3.4.9 probably caused by Clang.
I was moving a small number of Cocoapods dependencies' source files into the project, and when I tried to compile my project I got the error:
ld: framework not found ModelIO for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What does this mean? ModelIO is not mentioned anywhere in my project, and my linked frameworks do not mention it either.
I got this error message after adding SupportKit to my Podfile. Per the SupportKit release notes, they require Xcode 7 as of 2.10.1 and trying to use it while still on 6.x can produce this error: https://github.com/radialpoint/SupportKit/issues/54.
I am trying to build a program that relies on wxWidgets to run properly. I have the latest version of Xcode installed. I have tried building wxWidgets (both wxWidgets-3.0.2 and wxWidgets-2.9.4, the version originally used by the main program). However, in both cases, running the makefile for the main program gives the following error:
make: /Users/path to wxWidgets/wxWidgets-2.9.4/build-cocoa-release/utils/wxrc/wxrc: No such file or directory
As I understand it, I need to build wxrc to get my main program to build properly (I have tried this, but apparently some header files are missing). Is there any way to configure wxWidgets before this step that will automatically build wxrc as well? Or is that something I need to build separately? If it is separate, how would that be done?
I've pasted the code I originally used to configure wxWidgets below, with line breaks to make it easier to read:
../configure --with-osx_cocoa --with-macosx-version-min=10.7
--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
--prefix="$(pwd)" --with-opengl CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=c++11"
OBJCXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS=-stdlib=libc++
There is one error while building wxWidgets:
../src/osx/cocoa/utils.mm:250:28: error: cannot initialize a parameter of type 'id' with an lvalue of type
'wxNSAppController *'
[NSApp setDelegate:appcontroller];
When I go into the samples directory and enter "make", I get: ld: library not found for -lwx_osx_cocoau_xrc-2.9 clang: error: linker command failed with exit code 1 (use -v to see invocation) When entering "make" in demos, I get: ld: library not found for -lwx_osx_cocoau_core-2.9 clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I missed any steps I should have taken before these (something with Xcode maybe?) please let me know. Thank you very much in advance.
Similar question. I have sugested a workaround proposed on a forum as follows: you can use --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/".
I'm aiming to install openmpi 1.6.5 on my Macbook Pro, mountainlion 10.8.5, by following the straightforward guidelines at:
https://wiki.helsinki.fi/display/HUGG/Installing+Open+MPI+on+Mac+OS+X
While configuring with
./configure --prefix=/usr/local/bin F77=gfortran FC=gfortran
is successful, "make all" fails with:
clang: warning: argument unused during compilation: '-fopenmp'
CXXLD vtfilter
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[7]: *** [vtfilter] Error 1
As a complete newbie, I'm stuck on this error... I read about it error here:
Error enabling openmp - "ld: library not found for -lgomp" and Clang errors
(sorry for the new thread on possibly the same issue--this website's instructions guided me to not post a new question as an answer to an old thread...)
I'm not sure if these fixes apply here (?)-- I've tried the ordering within $PATH, which had no effect. Does this look like I have an issue with my compilers? If there is more useful information I can post, please let me know.
Thank you for your time and help!
It would be much easier if you simply disable building of the bundled VampirTrace library:
$ ./configure --enable-contrib-no-build=vt ...
If you still need to trace and profile your MPI applications, you could download VampirTrace and build it separately.