ugo-nama-kun / gym_torcs

MIT License
409 stars 163 forks source link

Not able to make in vtorcs #56

Open AliBaheri opened 6 years ago

AliBaheri commented 6 years ago

In Ubunto 18, when I run ./configure everything goes smoothly. But when I command "make" I am facing with the following error. Could you please help me?

make TORCS_BASE=/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color MAKE_DEFAULT=/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/Make-default.mk make[1]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color' make[2]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/interfaces' Exporting car.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/car.h Exporting graphic.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/graphic.h Exporting js.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/js.h Exporting playerpref.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/playerpref.h Exporting raceman.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/raceman.h Exporting replay.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/replay.h Exporting robot.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/robot.h Exporting simu.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/simu.h Exporting telemetry.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/telemetry.h Exporting track.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/track.h make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/interfaces' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml' Exporting xml.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/xml.h Exporting xmlparse.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/xmlparse.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/tgf' Exporting tgf.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tgf.h Exporting os.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/os.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/tgf' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/tgfclient' Exporting tgfclient.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tgfclient.h Exporting screen_properties.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/screen_properties.h Exporting glfeatures.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/glfeatures.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/tgfclient' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/client' Exporting client.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/client.h Exporting exitmenu.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/exitmenu.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/client' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/confscreens' Exporting confscreens.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/confscreens.h Exporting driverconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/driverconfig.h Exporting joystickconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/joystickconfig.h Exporting mouseconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/mouseconfig.h Exporting controlconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/controlconfig.h Exporting graphconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/graphconfig.h Exporting simuconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/simuconfig.h Exporting soundconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/soundconfig.h Exporting openglconfig.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/openglconfig.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/confscreens' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/racescreens' Exporting racescreens.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/racescreens.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/racescreens' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/robottools' Exporting robottools.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/robottools.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/robottools' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/raceengineclient' Exporting singleplayer.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/singleplayer.h Exporting raceinit.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/raceinit.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/raceengineclient' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/learning' Exporting policy.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/policy.h Exporting ann_policy.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/ann_policy.h Exporting ANN.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/ANN.h Exporting learn_debug.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/learn_debug.h Exporting real.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/real.h Exporting string_utils.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/string_utils.h Exporting List.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/List.h Exporting MathFunctions.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/MathFunctions.h Exporting Distribution.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/learning/Distribution.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/learning' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/portability' Exporting portability.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/portability.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/portability' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/math' Exporting linalg_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/linalg_t.h Exporting v2_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/v2_t.h Exporting v3_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/v3_t.h Exporting v4_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/v4_t.h Exporting straight2_t.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/tmath/straight2_t.h make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/math' make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/linux' Exporting osspec.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/osspec.h make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/linux' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu' make[5]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2' make[6]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0' make[7]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include' make[8]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include/3D' Exporting Basic.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Basic.h Exporting Matrix.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Matrix.h Exporting Point.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Point.h Exporting Quaternion.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Quaternion.h Exporting Tuple3.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Tuple3.h Exporting Tuple4.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Tuple4.h Exporting Vector.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/3D/Vector.h make[8]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include/3D' make[8]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include/SOLID' Exporting solid.h to /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/export/include/SOLID/solid.h make[8]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include/SOLID' make[7]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0/include' make[6]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2/SOLID-2.0' make[5]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu/simuv2' make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules/simu' make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/modules' make[2]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[2]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml' make[5]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml/gennmtab' make[5]: Nothing to be done for 'tools'. make[5]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml/gennmtab' make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/txml' make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/accc' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/accc' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/nfs2ac' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/nfs2ac' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/nfsperf' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/nfsperf' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/package' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/package' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/texmapper' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/texmapper' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/trackgen' make[4]: Nothing to be done for 'tools'. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools/trackgen' make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/tools' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/linux' make[3]: Nothing to be done for 'tools'. make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/linux' make[2]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[2]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' make[3]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' make[4]: Entering directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/confscreens' make[4]: *** No rule to make target '/home/abaheri/Desktop/gym_torcs-master/gym_torcs-master/vtorcs-RL-color/export/include/tgfclient.h', needed by 'controlconfig.o'. Stop. make[4]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs/confscreens' /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/Make-default.mk:679: recipe for target 'subdirs' failed make[3]: *** [subdirs] Error 1 make[3]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src/libs' /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/Make-default.mk:679: recipe for target 'subdirs' failed make[2]: *** [subdirs] Error 1 make[2]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/src' /home/abaheri/Desktop/gym_torcs/vtorcs-RL-color/Make-default.mk:679: recipe for target 'subdirs' failed make[1]: *** [subdirs] Error 1 make[1]: Leaving directory '/home/abaheri/Desktop/gym_torcs/vtorcs-RL-color' Makefile:30: recipe for target 'restart' failed make: *** [restart] Error2``

layely commented 5 years ago

Same here. @AliBaheri were you able to solve this. If yes, how, please? I am running Ubuntu 18.04.

ThePancakerizer commented 5 years ago

Same here on Ubuntu 18.10

W-yk commented 5 years ago

Make-default.mk:240: recipe for target 'geometry.o' failed on Ubuntu 18.10

Jaeuk-Shin commented 5 years ago

Same here on Ubuntu 18.04. Is it version mismatch error?

frknayk commented 5 years ago

Same here Ubuntu 16.04 !

deltaflyer commented 5 years ago

Here are all patches that I applied to vtorcs to make it compile on Ubuntu 18.04.

Resolving the isnan issue:

+++ b/src/drivers/olethros/geometry.cpp
@@ -370,7 +370,7 @@ void EstimateSphere (std::vector<Vector> P, ParametricSphere* sphere)
                                }
                                delta_total += delta;
                        }
-                       if (isnan(r)) {
+                       if (std::isnan(r)) {
                                for (i=0; i<d; i++) {
                                        center[i] =  ((*(sphere->C))[i] - mean[i]) / scale;
                                }

Fix for resolving the compatibility with Ubuntu's 18.04 libpng version:

@@ -98,7 +98,8 @@ GfImgReadPng(const char *filename, int *widthp, int *heightp, float screen_gamma
                return (unsigned char *)NULL;
        }

-       if (setjmp(png_ptr->jmpbuf))
+       //if (setjmp(png_ptr->jmpbuf))
+       if (setjmp(png_jmpbuf(png_ptr)))
        {
                /* Free all of the memory associated with the png_ptr and info_ptr */
                png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
@@ -229,7 +230,8 @@ GfImgWritePng(unsigned char *img, const char *filename, int width, int height)
                return -1;
        }

-       if (setjmp(png_ptr->jmpbuf)) {    
+       //if (setjmp(png_ptr->jmpbuf)) {
+       if (setjmp(png_jmpbuf(png_ptr))) {
                png_destroy_write_struct(&png_ptr, &info_ptr);
                fclose(fp);
                return -1;

Make sure, you have the right packages installed:

 sudo apt-get install libglib2.0-dev  libgl1-mesa-dev libglu1-mesa-dev  freeglut3-dev  libplib-dev  libopenal-dev libalut-dev libxi-dev libxmu-dev libxrender-dev  libxrandr-dev libpng-dev

Afterwards compile like this:

export CFLAGS="-fPIC"
export CPPFLAGS=$CFLAGS
export CXXFLAGS=$CFLAGS
configure
make clean
make install
make datainstall
root999 commented 4 years ago

Here are all patches that I applied to vtorcs to make it compile on Ubuntu 18.04.

Resolving the isnan issue:

+++ b/src/drivers/olethros/geometry.cpp
@@ -370,7 +370,7 @@ void EstimateSphere (std::vector<Vector> P, ParametricSphere* sphere)
                                }
                                delta_total += delta;
                        }
-                       if (isnan(r)) {
+                       if (std::isnan(r)) {
                                for (i=0; i<d; i++) {
                                        center[i] =  ((*(sphere->C))[i] - mean[i]) / scale;
                                }

Fix for resolving the compatibility with Ubuntu's 18.04 libpng version:

@@ -98,7 +98,8 @@ GfImgReadPng(const char *filename, int *widthp, int *heightp, float screen_gamma
                return (unsigned char *)NULL;
        }

-       if (setjmp(png_ptr->jmpbuf))
+       //if (setjmp(png_ptr->jmpbuf))
+       if (setjmp(png_jmpbuf(png_ptr)))
        {
                /* Free all of the memory associated with the png_ptr and info_ptr */
                png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
@@ -229,7 +230,8 @@ GfImgWritePng(unsigned char *img, const char *filename, int width, int height)
                return -1;
        }

-       if (setjmp(png_ptr->jmpbuf)) {    
+       //if (setjmp(png_ptr->jmpbuf)) {
+       if (setjmp(png_jmpbuf(png_ptr))) {
                png_destroy_write_struct(&png_ptr, &info_ptr);
                fclose(fp);
                return -1;

Make sure, you have the right packages installed:

 sudo apt-get install libglib2.0-dev  libgl1-mesa-dev libglu1-mesa-dev  freeglut3-dev  libplib-dev  libopenal-dev libalut-dev libxi-dev libxmu-dev libxrender-dev  libxrandr-dev libpng-dev

Afterwards compile like this:

export CFLAGS="-fPIC"
export CPPFLAGS=$CFLAGS
export CXXFLAGS=$CFLAGS
configure
make clean
make install
make datainstall

Hey, I just issued with same problem but I honestly cant found where this GfImgReadPng() function is ? can you help me about that ? Thanks a lot

sprakashdash commented 4 years ago

@root999 Going through a repo search you can find it at: gym_torcs/vtorcs-RL-color/src/libs/tgfclient/img.cpp

yanpanlau commented 4 years ago

Ubuntu 18.04 is using g++ 7.50 where the original code need to compile under g++ 5.xx. See the following post how to compile using g++ 5.0.

https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa