building on FreeBSD 7.2 fails

Discussion and help for Compilation problems and platform portability.

Moderators: Dade, coordinators

building on FreeBSD 7.2 fails

Postby bany » Fri Sep 18, 2009 5:30 am

Im trying to build on FreeBSD 7.2, I installed every dependencies, run cmake and everything goes ok..

but when I run make Im stuck with this:

[ 0%] Generating luxparse.cpp
[ 1%] Generating luxlex.cpp
Scanning dependencies of target lux
[ 1%] Building CXX object CMakeFiles/lux.dir/luxparse.o
c++: No input files specified
*** Error code 1

Stop in blah blah blah..

Someone has an Idea of what Im doing wrong??
bany
 
Posts: 15
Joined: Thu Sep 17, 2009 1:26 am

Re: building on FreeBSD 7.2 fails

Postby jeanphi » Fri Sep 18, 2009 3:40 pm

Hi,

Do you see the luxparse.cpp, luxparse.hpp and luxlex.cpp in the source folder? Also check the .log files in the CMakeFiles folder, they might have more detailed information.

Jeanphi
jeanphi
Developer
 
Posts: 7943
Joined: Mon Jan 14, 2008 7:21 am

Re: building on FreeBSD 7.2 fails

Postby bany » Sat Sep 19, 2009 5:08 am

yes the files are there.. here's the CMakeFiles Error log:

/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
/usr/bin/gcc -DCHECK_FUNCTION_EXISTS=pthread_create -fPIC CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o -o cmTryCompileExec -lpthreads
gmake[1]: Leaving directory `/usr/home/user/Desktop/LuxRender/build/CMakeFiles/CMakeTmp'
/usr/bin/ld: cannot find -lpthreads
gmake[1]: *** [cmTryCompileExec] Error 1
gmake: *** [cmTryCompileExec/fast] Error 2

??? im stuck.
bany
 
Posts: 15
Joined: Thu Sep 17, 2009 1:26 am

Re: building on FreeBSD 7.2 fails

Postby Dade » Sat Sep 19, 2009 7:01 am

bany wrote:/usr/bin/ld: cannot find -lpthreads


It looks like you are missing the "pthread" library.
User avatar
Dade
Developer
 
Posts: 8404
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: building on FreeBSD 7.2 fails

Postby bany » Sat Sep 19, 2009 9:42 am

tought so but my pkg_info|grep thread shows

libpthread-stubs-0.1 This library provides weak aliases for pthread functions

and I didnt see other pthread packages in the ports.. :shock:

btw, this error log is made by cmake (which anyway passes ok) and not bye the subsequent make..

heres' the actual output of cmake:

251# cmake ../lux-53863e4d0a98
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Building for target i386-undermydesk-freebsd
-- Looking for XOpenDisplay in /usr/local/lib/libX11.so;/usr/local/lib/libXext.so
-- Looking for XOpenDisplay in /usr/local/lib/libX11.so;/usr/local/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/local/lib/libX11.so
-- OpenGL include directory: /usr/local/include
-- Boost version: 1.37.0
-- Found the following Boost libraries:
-- Boost library directory: /usr/local/lib
-- Boost include directory: /usr/local/include
-- Found ZLIB: /usr/lib/libz.so
-- Found PNG: /usr/local/lib/libpng.so
-- Found TIFF: /usr/local/lib/libtiff.so
-- Found TIFF: /usr/local/lib/libtiff.so
-- Found JPEG: /usr/local/lib/libjpeg.so
-- JPEG include directory: /usr/local/include
-- Found wxWidgets: TRUE
-- wxWidgets include directory: /usr/local/lib/wx/include/gtk2-ansi-release-2.8/usr/local/include/wx-2.8
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/Desktop/LuxRender/build
252#

as for my building procedure, Im following what shown in the "building on Linux" page, Ubuntu section..
Ive unTARed the whole .bz2 in ~/lux, then made in lux a build subdir, so that my in build trre is such that in ~/lux i`ve build (empty) and lux-53863e4d0a98, then
cd build
cmake ../lux-53863e4d0a98
make

am I doing something wrong?
bany
 
Posts: 15
Joined: Thu Sep 17, 2009 1:26 am

Re: building on FreeBSD 7.2 fails

Postby Dade » Sun Sep 20, 2009 7:35 am

bany wrote:am I doing something wrong?


I have done some search with google. I have not well understood the status of the pthreads library under FreeBSD: it looks like the functions are implemented somewhere else (for instance inside libc or pthread).

You could try to edit the Makefile and just remove the "-lpthreads". Try to recompile and look if you get unresolved symbols or it works :?:
User avatar
Dade
Developer
 
Posts: 8404
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: building on FreeBSD 7.2 fails

Postby gagar » Sun Sep 20, 2009 8:34 am

Dade wrote:You could try to edit the Makefile and just remove the "-lpthreads". Try to recompile and look if you get unresolved symbols or it works :?:


That, or replace -lpthread (no 's'!) by -pthread, which I think is the standard FreeBSD way.
gagar
 
Posts: 35
Joined: Mon Dec 08, 2008 4:50 pm

Re: building on FreeBSD 7.2 fails

Postby bany » Mon Sep 21, 2009 9:12 am

Ive solved the issue..

there's an error in the generated make files, in particular:

CMakeFiles/lux.dir/flags.make
CMakeFiles/luxconsole.dir/flags.make
CMakeFiles/luxconsole.dir/link.txt
CMakeFiles/luxmerger.dir/flags.make
CMakeFiles/luxmerger.dir/link.txt
CMakeFiles/luxrender.dir/flags.make
CMakeFiles/luxrender.dir/link.txt

in each of these there's an error at the beginning of the CXX_FLAGS line

the first option is CXX_FLAGS = -pthread;-D_THREAD_SAFE

you need to erase the ; and separate the 2 options

NOW it compiles.. (and run!) :D :D :D


PS: do I have to report this behavior to someone?
bany
 
Posts: 15
Joined: Thu Sep 17, 2009 1:26 am

Re: building on FreeBSD 7.2 fails

Postby psor » Mon Sep 21, 2009 10:16 am

Wow, that's great bany! I'm wondering if you where crawling through all files. :o :mrgreen: ;)



take care
psor
"The sleeper must awaken"
User avatar
psor
 
Posts: 295
Joined: Mon Oct 22, 2007 7:16 pm
Location: Berlin, GER

Re: building on FreeBSD 7.2 fails

Postby Dade » Mon Sep 21, 2009 10:41 am

bany wrote:I
the first option is CXX_FLAGS = -pthread;-D_THREAD_SAFE

you need to erase the ; and separate the 2 options


We should find why to fix this problem by modifying the CMakeLists.txt (the source file used by cmake to generate all makefiles). However CMakeLists.txt looks correct to me and it works on other platforms.

I wonder if it is more "cmake on FreeBSD" bug than a bug in the Luxrender building system :?:
User avatar
Dade
Developer
 
Posts: 8404
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Next

Return to Compilation & Portability

Who is online

Users browsing this forum: No registered users and 1 guest