Re: Newbie with compile error and flightgear-2.8.0

"Cook, Rich" <[email protected]> Wed, 10 Oct 2012 17:50:55 +0000
Newsgroups gmane.games.flightgear.general
Message-ID <[email protected]>
On Oct 10, 2012, at 10:31 AM, Curtis Olson wrote:

Hopefully one of our cmake gurus can jump in and comment at this point.  I get clean builds on Fedora, so if I ran into something like this on my system, I'd probably wipe my build try and start from scratch.

yep, building clean

I may look at making sure simgear was built at the same time and from the same vintage and under the same conditions as flightgear.

yep, freshly built from a matching version

I'd double check I didn't update or change or add packages to this system in mid build (or after building simgear, but before building flightgear, etc.)

Nope, no changes

 It could be as simple as something being out of sync because the system (libs or compiler) was updated midway through the build.  It maybe that the udev check failed to locate the library (but still somehow passed the check or didn't abort the build) so that the build continued and found the header, but the library was never included in the link line (thus those functions are not found.)

Unlikely in the extreme  :-)  I repeatedly get the same error every time.

The real question to me is how it is that I'm getting "undefined reference to udev_new()"  when I'm clearly linking against /lib64/libudev.so.0.5.1.
I think there is something wrong with our libudev, but I don't know what.
I wrote a test program:

#include <libudev.h>

int main(int, char **) {
    struct udev * udev = udev_new();
    return 0;
}

I then did this:

rcook@rzgpu2 (FlightGear): g++ -I/usr/include test.C /usr/lib64/libudev.so
/var/tmp/rcook/ccF1vmxU.o: In function `main':
test.C:(.text+0x10): undefined reference to `udev_new()'
collect2: ld returned 1 exit status

Huh.  HElp?



Curt.


On Wed, Oct 10, 2012 at 12:23 PM, Cook, Rich <[email protected]<mailto:[email protected]>> wrote:
Hi, we do have libudev-devel installed...

rcook@rzgpu52 (flightgear-2.8.0-build): rpm -qf /lib64/libudev.so.0
libudev-147-2.40.el6.x86_64
rcook@rzgpu52 (flightgear-2.8.0-build): ls /usr/include/libudev.h
/usr/include/libudev.h
rcook@rzgpu52 (flightgear-2.8.0-build): rpm -qf !$
rpm -qf /usr/include/libudev.h
libudev-devel-147-2.40.el6.x86_64

If not, I assume that CMakeFiles/fgfs.dir/__/Input/FGLinuxEventInput.cxx.o would not have compiled at all.

On Oct 10, 2012, at 10:07 AM, Curtis Olson wrote:

Hi Rich,

One quick thing to try to would be to make sure you have the -devel version of the library installed.  That usually provides .h / include files and also static versions of the libs.  I don't know how this is specifically checked for in cmake, but often you look for the correct .h file (or the existance of a .a file) to know the development version of a package is installed and usable by the compiler.

Curt.


On Wed, Oct 10, 2012 at 11:57 AM, Cook, Rich wrote:
Hi, I'm so close to getting this working on our cluster.  Believe it or not, I have a deadline.  LOL
Can someone help me figure out what is wrong?  I would so much appreciate it!
Thanks

I do this:
 cmake -D CMAKE_BUILD_TYPE="Release" CMAKE_CXX_FLAGS="-O3 -D__STDC_CONSTANT_MACROS" -D CMAKE_C_FLAGS="-O3" -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON -D CMAKE_INSTALL_PREFIX:PATH="/collab/usr/gapps/asciviz/flightgear/" -D "CMAKE_PREFIX_PATH=/collab/usr/gapps/asciviz/flightgear/" ../flightgear-2.8.0 && sleep 5 && make -j 24 2>&1 | tee output.log

I get this (I have snipped a large portion of the link line for readability)

[ 31%] Built target JSBSim
make -f src/Main/CMakeFiles/fgfs.dir/build.make src/Main/CMakeFiles/fgfs.dir/depend
make[2]: Entering directory `/nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build'
cd /nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build && /usr/local/tools/cmake-2.8.7/bin/cmake -E cmake_depends "Unix Makefiles" /nfs/tmp2/rcook/FlightGear/flightgear-2.8.0 /nfs/tmp2/rcook/FlightGear/flightgear-2.8.0/src/Main /nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build /nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build/src/Main /nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build/src/Main/CMakeFiles/fgfs.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build'
make -f src/Main/CMakeFiles/fgfs.dir/build.make src/Main/CMakeFiles/fgfs.dir/build
make[2]: Entering directory `/nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build'
Linking CXX executable fgfs
cd /nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build/src/Main && /usr/local/tools/cmake-2.8.7/bin/cmake -E cmake_link_script CMakeFiles/fgfs.dir/link.txt --verbose=1
/usr/bin/c++   -I/collab/usr/gapps/asciviz/flightgear/include  -Wall  -D_REENTRANT -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_BIMAP_DISABLE_SERIALIZATION -O3 -DNDEBUG   -I/collab/usr/gapps/asciviz/flightgear/lib -L/collab/usr/gapps/asciviz/flightgear/lib64  CMakeFiles/fgfs.dir/bootstrap.cxx.o CMakeFiles/fgfs.dir/fg_commands.cxx.o CMakeFiles/fgfs.dir/fg_init.cxx.o CMakeFiles/fgfs.dir/fg_io.cxx.o CMakeFiles/fgfs.dir/fg_os_common.cxx.o CMakeFiles/fgfs.dir/fg_props.cxx.o CMakeFiles/fgfs.dir/globals.cxx.o CMakeFiles/fgfs.dir/locale.cxx.o CMakeFiles/fgfs.dir/logger.cxx.o CMakeFile  ... etc  ... full text below ... a /collab/usr/gapps/asciviz/flightgear/lib/libplibsg.a /collab/usr/gapps/asciviz/flightgear/lib/libplibpu.a /collab/usr/gapps/asciviz/flightgear/lib/libplibul.a -ludev -lpthread -lz -lapr-1 -lsvn_client-1 -lsvn_subr-1 -lsvn_ra-1 -lrt /collab/usr/gapps/asciviz/flightgear/lib/libalut.so /collab/usr/gapps/asciviz/flightgear/lib/libopenal.so ../Canvas/ShivaVG/src/libShivaVG.a -lGLU -lGL -Wl,-rpath,/collab/usr/gapps/asciviz/flightgear/lib64:/collab/usr/gapps/asciviz/flightgear/lib:
CMakeFiles/fgfs.dir/__/Input/FGLinuxEventInput.cxx.o: In function `FGLinuxEventInput::postinit()':
FGLinuxEventInput.cxx:(.text+0x4d9): undefined reference to `udev_new()'
FGLinuxEventInput.cxx:(.text+0x4e6): undefined reference to `udev_enumerate_new(udev*)'
FGLinuxEventInput.cxx:(.text+0x4f6): undefined reference to `udev_enumerate_add_match_subsystem(udev_enumerate*, char const*)'
FGLinuxEventInput.cxx:(.text+0x4fe): undefined reference to `udev_enumerate_scan_devices(udev_enumerate*)'
FGLinuxEventInput.cxx:(.text+0x506): undefined reference to `udev_enumerate_get_list_entry(udev_enumerate*)'
FGLinuxEventInput.cxx:(.text+0x5c7): undefined reference to `udev_device_unref(udev_device*)'
FGLinuxEventInput.cxx:(.text+0x5cf): undefined reference to `udev_list_entry_get_next(udev_list_entry*)'
FGLinuxEventInput.cxx:(.text+0x5e3): undefined reference to `udev_list_entry_get_name(udev_list_entry*)'
FGLinuxEventInput.cxx:(.text+0x5f0): undefined reference to `udev_device_new_from_syspath(udev*, char const*)'
FGLinuxEventInput.cxx:(.text+0x5fb): undefined reference to `udev_device_get_devnode(udev_device*)'
FGLinuxEventInput.cxx:(.text+0x606): undefined reference to `udev_device_get_parent(udev_device*)'
FGLinuxEventInput.cxx:(.text+0x616): undefined reference to `udev_device_get_sysattr_value(udev_device*, char const*)'
FGLinuxEventInput.cxx:(.text+0x6fe): undefined reference to `udev_unref(udev*)'
collect2: ld returned 1 exit status
make[2]: *** [src/Main/fgfs] Error 1
make[2]: Leaving directory `/nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build'
make[1]: *** [src/Main/CMakeFiles/fgfs.dir/all] Error 2
make[1]: Leaving directory `/nfs/tmp2/rcook/FlightGear/flightgear-2.8.0-build'
make: *** [all] Error 2

Note that we do have libudev installed, but perhaps it's the wrong version ?  I don't know what's wrong here.

rcook@rzgpu52 (flightgear-2.8.0-build): ls -l /usr/lib64/libudev.so
lrwxrwxrwx 1 root root 28 Sep 18 19:30 /usr/lib64/libudev.so -> ../../lib64/libudev.so.0.5.1
rcook@rzgpu52 (flightgear-2.8.0-build): ls -l /lib64/libudev.so.0*
lrwxrwxrwx 1 root root    16 Sep 18 19:25 /lib64/libudev.so.0 -> libudev.so.0.5.1
-rwxr-xr-x 1 root root 59192 Sep 23  2011 /lib64/libudev.so.0.5.1


--
✐Richard Cook
✇ Lawrence Livermore National Laboratory
Bldg-453 Rm-4024, Mail Stop L-557
7000 East Avenue,  Livermore, CA, 94550, USA
☎ (office) (925) 423-9605<tel:%28925%29%20423-9605>
☎ (fax) (925) 423-6961<tel:%28925%29%20423-6961>
---
Information Management & Graphics Grp., Services & Development Div., Integrated Computing & Communications Dept.
(opinions expressed herein are mine and not those of LLNL)



------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Flightgear-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/flightgear-users



--
Curtis Olson:
http://www.atiak.com<http://www.atiak.com/> - http://aem.umn.edu/~uav/
http://www.flightgear.org<http://www.flightgear.org/> - http://gallinazo.flightgear.org<http://gallinazo.flightgear.org/>

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev_______________________________________________
Flightgear-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/flightgear-users

--
✐Richard Cook
✇ Lawrence Livermore National Laboratory
Bldg-453 Rm-4024, Mail Stop L-557
7000 East Avenue,  Livermore, CA, 94550, USA
☎ (office) (925) 423-9605<tel:%28925%29%20423-9605>
☎ (fax) (925) 423-6961<tel:%28925%29%20423-6961>
---
Information Management & Graphics Grp., Services & Development Div., Integrated Computing & Communications Dept.
(opinions expressed herein are mine and not those of LLNL)




------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Flightgear-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/flightgear-users




--
Curtis Olson:
http://www.atiak.com<http://www.atiak.com/> - http://aem.umn.edu/~uav/
http://www.flightgear.org<http://www.flightgear.org/> - http://gallinazo.flightgear.org<http://gallinazo.flightgear.org/>


--
✐Richard Cook
✇ Lawrence Livermore National Laboratory
Bldg-453 Rm-4024, Mail Stop L-557
7000 East Avenue,  Livermore, CA, 94550, USA
☎ (office) (925) 423-9605
☎ (fax) (925) 423-6961
---
Information Management & Graphics Grp., Services & Development Div., Integrated Computing & Communications Dept.
(opinions expressed herein are mine and not those of LLNL)

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

_______________________________________________
Flightgear-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-users