Error installing SDL-ttf-0.6.2.1 in Haskell: cannot find -lSDL_ttf - cabal-install

I'm running into the following problem trying to cabal install reactive-banana-sdl:
c:/program files/haskell platform/7.10.2-a/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL_ttf
collect2: ld returned 1 exit status
linking dist\build\Graphics\UI\SDL\TTF\Version_hsc_make.o failed (exit code 1)
command was: C:\Program Files\Haskell Platform\7.10.2-a\mingw\bin\gcc.exe dist\build\Graphics\UI\SDL\TTF\Version_hsc_make.o dist\build\Graphics\UI\SDL\TTF\Version_hsc_utils.o -o dist\build\Graphics\UI\SDL\TTF\Version_hsc_make.exe -LC:PFSDL_ttf-2.0.11-win32-x64 -lSDL_ttf -LC:\Users\Owner\AppData\Roaming\cabal\x86_64-windows-ghc-7.10.2\SDL-0.6.5.1-26jmephxohM5v84vz7MqXX -LC:/PF/sdl/lib -lSDL -L/mingw64/lib -lmingw32 -lSDLmain -lSDL -mwindows -LC:\Program Files\Haskell Platform\7.10.2-a\lib\base_GDytRqRVSUX7zckgKqJjgw -lwsock32 -luser32 -lshell32 -LC:\Program Files\Haskell Platform\7.10.2-a\lib\integ_2aU3IZNMF9a7mQ0OzsZ0dS -LC:\Program Files\Haskell Platform\7.10.2-a\lib\ghcpr_8TmvWUcS1U1IKHT0levwg3 -LC:\Program Files\Haskell Platform\7.10.2-a\lib/rts -lm -lwsock32 -lgdi32 -lwinmm
C:\Program Files\Haskell Platform\7.10.2-a\bin\hsc2hs.exe returned ExitFailure 1
Failed to install SDL-ttf-0.6.2.1
What do I do?
Some details: I'm using Windows 7, and doing this in MINGW64. I've installed sdl-ttf through pacman, downloaded SDL_ttf from https://www.libsdl.org/projects/SDL_ttf/release-1.2.html, and replaced SDL_platform.h (https://hg.libsdl.org/SDL/raw-file/e217ed463f25/include/SDL_platform.h) to fix another error ("winapifamily.h: No such file or directory" when compiling SDL in Code::Blocks). I made sure to include extra directories.
cabal install -v3 reactive-banana-sdl --extra-include-dirs=C:\PF\SDL_ttf-2.0.11-win32-x64 --extra-lib-dirs=C:\PF\SDL_ttf-2.0.11-win32-x64

Related

Make does not detect opencv_contrib even though I have it installed

I am trying to get this running https://github.com/Katou2/Optical_Flow_GPU_Opencv3 but am facing an issue where make does not detect my opencv_contrib module. Here are the steps that I have done up till cmake.
conda create -n opticalflow python=3.6 anaconda
conda activate opticalflow
git clone https://github.com/Katou2/Optical_Flow_GPU_Opencv3
cd Optical_Flow_GPU_Opencv3
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D BUILD_TIFF=ON ..
And this is the output that I get with no error.
-- version: 4.2.0
-- OPENCV include: /home/haziq/anaconda3/pkgs/libopencv-4.2.0-py36_3/include/opencv4
-- OPENCV libs dir:
-- OPENCV libs: opencv_calib3dopencv_coreopencv_dnnopencv_features2dopencv_flannopencv_gapiopencv_highguiopencv_imgcodecsopencv_imgprocopencv_mlopencv_objdetectopencv_photoopencv_stitchingopencv_videoopencv_videoioopencv_arucoopencv_bgsegmopencv_bioinspiredopencv_ccalibopencv_cvvopencv_datasetsopencv_dnn_objdetectopencv_dnn_superresopencv_dpmopencv_faceopencv_freetypeopencv_fuzzyopencv_hdfopencv_hfsopencv_img_hashopencv_line_descriptoropencv_optflowopencv_phase_unwrappingopencv_plotopencv_qualityopencv_regopencv_rgbdopencv_saliencyopencv_shapeopencv_stereoopencv_structured_lightopencv_superresopencv_surface_matchingopencv_textopencv_trackingopencv_videostabopencv_xfeatures2dopencv_ximgprocopencv_xobjdetectopencv_xphoto
-- Configuring done
-- Generating done
-- Build files have been written to: /home/haziq/Optical_Flow_GPU_Opencv3/build
The problem comes when I run make.
Scanning dependencies of target compute_flow_autogen
[ 25%] Automatic MOC for target compute_flow
[ 25%] Built target compute_flow_autogen
Scanning dependencies of target compute_flow
[ 50%] Building CXX object CMakeFiles/compute_flow.dir/compute_flow.o
/home/haziq/Optical_Flow_GPU_Opencv3/compute_flow.cpp:38:10: fatal error: opencv2/cudaoptflow.hpp: No such file or directory
#include "opencv2/cudaoptflow.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/compute_flow.dir/build.make:62: recipe for target 'CMakeFiles/compute_flow.dir/compute_flow.o' failed
make[2]: *** [CMakeFiles/compute_flow.dir/compute_flow.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/compute_flow.dir/all' failed
make[1]: *** [CMakeFiles/compute_flow.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
So the error mentions that the file opencv2/cudaoptflow.hpp is not found and I read through https://github.com/open-mmlab/mmaction/issues/39 says that the error is due to the opencv_contrib module not having been installed. However, I am certain that I already have opencv_contrib installed because I have this command executed.
pip install opencv-contrib-python
and have also verified it as I am able to call the cv2.xfeatures2d method which requires opencv_contrib to run.
import cv2
help(cv2.xfeatures2d) # cv2.xfeatures2d requires opencv_contrib

Error: File format not recognized

I'm using a Raspberry Pi 2 running Ubuntu MATE 15.10 to work on a project.
I'm trying to run a makefile and got this error
/home/dpanagou/Quadrotors/Vicon/libs/libViconDataStreamSDK_CPP.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:8: recipe for target '../bin/Vicon_state' failed
make[1]: *** [../bin/Vicon_state] Error 1
make[1]: Leaving directory '/home/dpanagou/Quadrotors/HLP/Vicon'
Makefile:40: recipe for target 'Vicon' failed
make: *** [Vicon] Error 2
I've also tried make clean before make.
From research, a lot of people have suggested that the object file might be corrupted. So I downloaded new files from the developer and ran the makefile again. I still get the same error.
Here is my makefile:
CUR_DIR = $(shell pwd)
CFLAGS = `pkg-config --cflags lcm`
LDFLAGS = `pkg-config --libs lcm` ../src/filter_util.o ../src/util.o
vicon_lib = $(CUR_DIR:%/HLP/Vicon=%/Vicon/libs)
../bin/Vicon_state:
g++ $(CFLAGS) Vicon_state_data.cpp -o ../bin/Vicon_state -Wl,- rpath=../../Vicon/libs -L$(vicon_lib) -lViconDataStreamSDK_CPP -lDebugServices $(LDFLAGS)
Please help with specific instructions as I am very new to Linux and programming.
Check the format of the file with the "file" command, and compare it to the format of any .so that comes with rpi.
I'm not 100% sure, but might it be that the library is for raspbian with its v6 compatible HF vs generic V7-only HF in debian?

Error installing petsc with homebrew

I tried installing petsc with homebrew on OSX 10.10.1 with:
$brew install petsc
I get one error installing one dependency:
==> Installing petsc dependency: hypre
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading http://ftp.mcs.anl.gov/pub/petsc/externalpackages/hypre-2.9.0b.tar.gz
Already downloaded: /Library/Caches/Homebrew/hypre-2.9.0b.tar.gz
Error: SHA1 mismatch
Expected: aaf8354437be38aa2fbcc944ab64d464a5b39207
Actual: bd7ca57e45badf322b9c9cb970403c191287da72
Archive: /Library/Caches/Homebrew/hypre-2.9.0b.tar.gz
To retry an incomplete download, remove the file above.
So I tried installing hypre with homebrew
$brew install hypre
and I didn't get any error
==> Summary
🍺 /usr/local/Cellar/hypre/2.9.0b_1: 48 files, 4.5M
Finally, I modified the petsc formula and commented out this line
depends_on "hypre" => ["with-mpi", :recommended]
Now I can install petsc but it doesn't work
configure:12901: WARNING: No PETSC_DIR set - trying to autodetect
configure:12919: Using PETSC_DIR=/usr/local
configure:12966: mpif90 -o conftest -ffast-math -frecord-marker=4 -DHAVE_NUMPY -I/usr/local/lib/python2.7/site-packages/numpy/core/include -fno-realloc-lhs -ffree-line-length-none -ffixed-line-length-none -O3 conftest.F90 -lparmetis -lmetis -llapack -lpthread -lm -lstdc++ -L/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -u _PyMac_Error /usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Python -ldl -framework CoreFoundation -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2 -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../.. -lgfortran -lquadmath -lm -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2 -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../.. -lgfortran -lquadmath -lm >&5
conftest.F90:3.30:
use petsc
1
Fatal Error: Can't open module file 'petsc.mod' for reading at (1): No such file or directory

Luarocks error building luafilesystem

I'm using Luarocks 2.2.0beta1 to install luafilesystem on windows 7 with lua 5.2 and mingw. I got this error:
>luarocks install luafilesystem
Installing http://rocks.moonscript.org/luafilesystem-1.6.2-2.src.rock...
Using http://rocks.moonscript.org/luafilesystem-1.6.2-2.src.rock... switching to 'build' mode
mingw32-gcc -O2 -c -o src/lfs.o -IC:/lua/include/src/lfs.c
mingw32-gcc -shared -o lfs.dll src/lfs.o C:/lua/bin/lua52.dll -lm
C:\lua\bin\lua52.dll: file not recognized: File format not recognized
collect2.exe: error: Id returned 1 exit status
Error: Build error: Failed compiling module lfs.dll
any idea how to fix this?
note: until now, I have no problem installing other module with luarocks that have no dependency with luafilesystem.
Solved, this problem arise because actually I'm not using the same MinGW compiler when building lua52.dll. I don't know which compiler I use at the first time. Thanks to #siffiejoe

I can't make SQSH 2.1.7 with freetds 0.91

I am having trouble building sqsh against freetds. This post cross-references with https://sourceforge.net/projects/sqsh/forums/forum/365924/topic/4716627.
I've installed Freetds 0.91 from sunfreeware.com on Solaris 10. I've confirmed the installation as noted in Chapter 9 of the user guide.
Following the sqsh notes from sqsh.org, I've set the SYBASE environment variable to /usr/local/freetds and run the configure script. (I do not have Sybase installed on this machine. I shouldn't need it.)
SYBASE=/usr/local/freetds; export SYBASE
./configure --with-readline
I've checked the Makefile, it seems to be right given what I've read.
SYBASE_LIBS = -lct -ltds -lnsl -ldl -lm
When I run make, I get(after building a bunch of stuff):
make
...
...[build output]...
...
gcc -L/usr/local/freetds/lib -L/usr/local/lib cmd_alias.o cmd_bcp.o cmd_buf.o cmd_connect.o cmd_do.o cmd_echo.o cmd_exit.o cmd_for.o cmd_func.o cmd_go.o cmd_help.o cmd_history.o cmd_if.o cmd_input.o cmd_jobs.o cmd_kill.o cmd_lock.o cmd_loop.o cmd_misc.o cmd_read.o cmd_reconnect.o cmd_redraw.o cmd_reset.o cmd_return.o cmd_rpc.o cmd_set.o cmd_shell.o cmd_show.o cmd_sleep.o cmd_wait.o cmd_warranty.o cmd_while.o var_ctlib.o var_date.o var_debug.o var_dsp.o var_hist.o var_misc.o var_passwd.o var_readline.o var_thresh.o dsp.o dsp_bcp.o dsp_csv.o dsp_conv.o dsp_desc.o dsp_horiz.o dsp_html.o dsp_meta.o dsp_none.o dsp_out.o dsp_pretty.o dsp_vert.o dsp_x.o sqsh_alias.o sqsh_args.o sqsh_avl.o sqsh_buf.o sqsh_cmd.o sqsh_compat.o sqsh_ctx.o sqsh_debug.o sqsh_env.o sqsh_error.o sqsh_expand.o sqsh_fd.o sqsh_filter.o sqsh_fork.o sqsh_func.o sqsh_getopt.o sqsh_global.o sqsh_history.o sqsh_init.o sqsh_job.o sqsh_readline.o sqsh_sig.o sqsh_sigcld.o sqsh_stdin.o sqsh_strchr.o sqsh_tok.o sqsh_varbuf.o sqsh_main.o -lct -ltds -lnsl -ldl -lm -lreadline -lcurses -o sqsh
ld: warning: global symbol `_END_' has non-global binding:
(file /usr/local/freetds/lib/libct.so value=LOCL);
ld: warning: global symbol `_START_' has non-global binding:
(file /usr/local/freetds/lib/libct.so value=LOCL);
ld: fatal: file /usr/local/freetds/lib/libtds.a: unknown file type
ld: fatal: File processing errors. No output written to sqsh
collect2: ld returned 1 exit status
make[1]: *** [sqsh] Error 1
make[1]: Leaving directory `/opt/BFMIfiles/src/sqsh-2.1.7/src'
make: *** [build-subdirs] Error 2
Is the error related to this: http://www.freetds.org/faq.html#where.is.libtds.so?
Any ideas?
Reference on freetds mailing list.
Reference on sqsh help forum.
When editing src/Makefile, get rid of -ltds (as suggested here) and change -ldl to -liconv. I got that last bit from the cygwin version of the sqsh README.
I used SYBASE=/usr/local/freetds/.
After that I had to set the LD_LIBRARY_PATH=$SYBASE/lib/:/usr/local/lib/ to get the freetds and liconv libraries.
Big thanks to the freetds mailing list. http://lists.ibiblio.org/pipermail/freetds/2011q3/027382.html

Resources