You are not logged in.

#1 2009-05-26 10:28:16

ReaphSharc
Member
From: the Netherlands
Registered: 2007-11-05
Posts: 138
Website

ngPlant failing to compile

I'm trying to install ngPlant, but compile fails:

==> Starting build()...
patching file ngput/p3dimage.cpp
patching file ngput/p3dospath.cpp
patching file ngpshot/ngpshot.cpp
patching file ngpshot/p3dshaders.cpp
patching file ngpview/ngpview.cpp
patching file SConstruct
scons: Reading SConscript files ...

scons: warning: The Options class is deprecated; use the Variables class instead.
File "/tmp/yaourt-tmp-gerritjo/aur-ngplant/ngplant/src/ngplant-0.9.7/SConstruct", line 18, in <module>

scons: warning: The BoolOption() function is deprecated; use the BoolVariable() function instead.
File "/tmp/yaourt-tmp-gerritjo/aur-ngplant/ngplant/src/ngplant-0.9.7/SConstruct", line 19, in <module>
Checking for c++ compiler presence... (cached) yes
Checking for __attribute__((unused)) support presence in g++... (cached) yes
Checking for C++ header file stdint.h... (cached) yes
Checking for C header file python2.5/Python.h... (cached) no
Python.h not found... _ngp (Python bindings) will not be built
Checking unsigned int type sizeof ... (cached) 4
Checking unsigned int* type sizeof ... (cached) 4
Checking endianess ... (cached) little
Checking for C function sincosf()... (cached) no
Checking for C++ function sincosf()... (cached) yes
Checking for C function roundf()... (cached) no
Checking for C++ function roundf()... (cached) yes
Checking for C++ header file GL/freeglut.h... (cached) yes
Checking GLEW presence and usability ... (cached) yes
Checking for xsltproc command... (cached) yes
Checking for lua_newstate function presence in Lua libraries ...(cached) yes

scons: warning: The env.Copy() method is deprecated; use the env.Clone() method instead.
File "/tmp/yaourt-tmp-gerritjo/aur-ngplant/ngplant/src/ngplant-0.9.7/ngpcore/SConscript", line 27, in <module>
scons: done reading SConscript files.
scons: Building targets ...
scons: `ngpcore/libngpcore.a' is up to date.
g++ -o ngput/p3dospath.o -c -W -Wall -O3 --fast-math -DHAVE_GXX_ARG_ATTR_UNUSED -DHAVE_STDINT_H -DUINTSIZE=4 -DUINTPTRSIZE=4 -DHAVE_SINCOSF -DHAVE_ROUNDF -I. ngput/p3dospath.cpp
ngput/p3dospath.cpp: In static member function 'static std::string P3DPathInfo::GetCurrentDir()':
ngput/p3dospath.cpp:124: error: 'FILENAME_MAX' was not declared in this scope
ngput/p3dospath.cpp:126: error: 'CurrentDirBuf' was not declared in this scope
ngput/p3dospath.cpp: At global scope:
ngput/p3dospath.cpp:261: warning: 'int p3d_memcaseeq(const char*, const char*, size_t)' defined but not used
scons: *** [ngput/p3dospath.o] Error 1
scons: building terminated because of errors.
==> ERROR: Build Failed.
    Aborting...
Error: Makepkg was unable to build ngplant package.

Does anyone know a solution?


Do you want a Bubble Icon? Feel free to submit your requests or personal creations to be included in future releases.
I'm 100% Linux!

Offline

#2 2009-05-26 18:31:19

stefanwilkens
Member
From: Enschede, the Netherlands
Registered: 2008-12-10
Posts: 624

Re: ngPlant failing to compile

what version of GCC are you using?


Arch i686 on Phenom X4 | GTX760

Offline

#3 2009-05-26 20:06:03

Garns
Member
Registered: 2008-05-28
Posts: 239

Re: ngPlant failing to compile

gcc4.4 I presume smile .

add

#include <cstdio>

to p3dospath.cpp

to do this you can change gcc43.patch as follows:

--- ngput/p3dimage.cpp.org
+++ ngput/p3dimage.cpp 
@@ -30,6 +30,7 @@
 ***************************************************************************/
 
 #include <stdlib.h>
+#include <cstring>
 
 #include <ngpcore/p3ddefs.h>
 #include <ngpcore/p3dtypes.h>

--- ngput/p3dospath.cpp.org
+++ ngput/p3dospath.cpp 
@@ -30,6 +30,8 @@
 ***************************************************************************/
 
 #include <stdlib.h>
+#include <cstring>
+#include <cstdio>

 #include <string>
 
--- ngpshot/ngpshot.cpp.org
+++ ngpshot/ngpshot.cpp 
@@ -20,6 +20,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <cstring>
 
 #include <new>
 #include <string>

--- ngpshot/p3dshaders.cpp.org
+++ ngpshot/p3dshaders.cpp 
@@ -19,6 +19,8 @@
 ***************************************************************************/
 
 #include <vector>
+#include <cstdio>
+#include <cstdlib>
 
 #include <ngput/p3dglext.h>
 
--- ngpview/ngpview.cpp.org 
+++ ngpview/ngpview.cpp 
@@ -20,6 +20,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <cstring>
 
 #include <ngput/p3dglext.h>

Offline

#4 2009-05-27 11:40:25

ReaphSharc
Member
From: the Netherlands
Registered: 2007-11-05
Posts: 138
Website

Re: ngPlant failing to compile

Thanks... and thanks for adding the comment in AUR.
It compiles further now, but now ends in

g++ -o ngplant/p3dpluglua.o -c -O3 --fast-math -pthread -DHAVE_GXX_ARG_ATTR_UNUSED -DHAVE_STDINT_H -DUINTSIZE=4 -DUINTPTRSIZE=4 -DHAVE_SINCOSF -DHAVE_ROUNDF -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -DNGP_LUA_VER=51 -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -Ingplant -I. ngplant/p3dpluglua.cpp
g++ -o ngplant/ngplant -s -pthread ngplant/p3dwx.o ngplant/p3dwxcurvectrl.o ngplant/p3dwxlistdlg.o ngplant/main.o ngplant/p3dcanvas3d.o ngplant/p3dcamera.o ngplant/p3dmedit.o ngplant/p3duimodelstemtube.o ngplant/p3duibalgstd.o ngplant/p3dmaterialstd.o ngplant/p3duimaterialstd.o ngplant/p3duioptgeneral.o ngplant/p3dtexture.o ngplant/p3didevfs.o ngplant/p3dexpobj.o ngplant/p3duimodelstemquad.o ngplant/p3duimodelstemwings.o ngplant/p3duibalgwings.o ngplant/p3duiappopt.o ngplant/p3duibalgbase.o ngplant/p3duivisrangepanel.o ngplant/p3dpobject.o ngplant/p3dhliext.o ngplant/p3dshaders.o ngplant/p3dlog.o ngplant/p3dpluginfo.o ngplant/p3duimodelstemempty.o ngplant/p3dappprefs.o ngplant/p3dplugluactl.o ngplant/p3dplugluahli.o ngplant/p3dplugluaui.o ngplant/p3dplugluaprefs.o ngplant/p3dpluglua.o -Lngpcore -Lngput -lGLEW -lwx_gtk2u_gl-2.8 -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8 -lngpcore -lngput -llua -lm
ngplant/main.o: In function `P3DMainFrame::OnEditPreferences(wxCommandEvent&)':
main.cpp:(.text+0x22ca): undefined reference to `__sync_fetch_and_add_4'
ngplant/main.o: In function `P3DApp::ScanPlugins()':
main.cpp:(.text+0x5a52): undefined reference to `__sync_fetch_and_add_4'
main.cpp:(.text+0x5aa2): undefined reference to `__sync_fetch_and_add_4'
main.cpp:(.text+0x5af2): undefined reference to `__sync_fetch_and_add_4'
main.cpp:(.text+0x5b45): undefined reference to `__sync_fetch_and_add_4'
ngplant/main.o:main.cpp:(.text+0x5d55): more undefined references to `__sync_fetch_and_add_4' follow
collect2: ld returned 1 exit status
scons: *** [ngplant/ngplant] Error 1
scons: building terminated because of errors.
==> ERROR: Build Failed.
    Aborting...

Do you want a Bubble Icon? Feel free to submit your requests or personal creations to be included in future releases.
I'm 100% Linux!

Offline

#5 2009-05-27 17:21:17

Garns
Member
Registered: 2008-05-28
Posts: 239

Re: ngPlant failing to compile

Ok I just ran pacman -Syu and now I can reproduce this. Seems to me there is some problem with the updated toolchain.

Offline

#6 2009-05-27 17:57:24

Garns
Member
Registered: 2008-05-28
Posts: 239

Re: ngPlant failing to compile

I got it to compile without optimization, I tried everythin from -O3 given in the buildscript down to nothing even -O fails. Not sure how this will affect performance.

If you want to build without optimization you can either edit SConstruct by hand or use the patch below.

--- SConstruct.orig    2009-05-27 18:54:12.668594310 +0100
+++ SConstruct    2009-05-27 18:51:42.137132289 +0100
@@ -229,7 +229,7 @@
     CC_WARN_FLAGS=''
 
 if 'gcc' in BaseEnv['TOOLS']:
-    CC_OPT_FLAGS='-O3 --fast-math'
+    CC_OPT_FLAGS='--fast-math'
 else:
     CC_OPT_FLAGS=''

Offline

#7 2009-05-28 15:47:54

Lux Perpetua
Member
From: The Local Group
Registered: 2009-02-22
Posts: 69

Re: ngPlant failing to compile

I'm having the __sync_fetch_and_add_4 problem with another C++ program that I wrote. It compiled without errors before the GCC upgrade. I'm not sure what's causing this, but I can get it to compile with optimizations (-O3) if I also pass a -march flag (-march=native, for example). You might try the same. Actually, since we're already talking about optimization, -march=native will tell the compiler to utilize the full instruction set available to your CPU, which can give you a nice performance gain.

Offline

#8 2009-05-28 20:10:20

Teld
Member
From: Nice, France
Registered: 2007-08-01
Posts: 15
Website

Re: ngPlant failing to compile

It appears that gcc and gcc-libs 4.4.0-1 result in a successful compilation. The upgrade to 4.4.0-2 breaks the compilation. For the moment I would suggest, if possible, a downgrade to 4.4.0-1 of gcc and gcc-libs. In the mean time I will try to investigate this further.

Offline

#9 2009-05-28 21:14:13

Garns
Member
Registered: 2008-05-28
Posts: 239

Re: ngPlant failing to compile

This is definitely a problem with gcc-4.4.0-2. See http://bugs.archlinux.org/task/14825. It compiles fine with gcc-4.4.0-3 from testing.

Offline

#10 2009-05-29 19:25:06

Teld
Member
From: Nice, France
Registered: 2007-08-01
Posts: 15
Website

Re: ngPlant failing to compile

I can confirm that compilation with version 4.4.0-3 from testing works without problem. So, I won't hack the scons configuration to work around a possible gcc bug.

Offline

Board footer

Powered by FluxBB