Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error making v1.7.3 from source #468

Closed
fourjay opened this issue Sep 20, 2023 · 8 comments
Closed

Fatal error making v1.7.3 from source #468

fourjay opened this issue Sep 20, 2023 · 8 comments

Comments

@fourjay
Copy link

fourjay commented Sep 20, 2023

v1.7.2 builds fine for me.
v1.7.3 errors out with:

[-Wmissing-noreturn -fno-strict-aliasing -pthread -MT conf/nfconf.lo -MD -MP -MF conf/.deps/nfconf.Tpo -c conf/nfconf.c  -fPIC -DPIC -o conf/.libs/nfconf.oconf/nfconf.c: In function ‘ConfOpen’:](libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -I.. -I../include -I../inline -Iconf -Icompress -ggdb -g -O3 -std=c99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing -pthread -MT conf/nfconf.lo -MD -MP -MF conf/.deps/nfconf.Tpo -c conf/nfconf.c  -fPIC -DPIC -o conf/.libs/nfconf.o)
conf/nfconf.c: In function ‘ConfOpen’:
conf/nfconf.c:91:35: error: ‘S_IFREG’ undeclared (first use in this function); did you mean ‘S_ISREG’?
         if (TestPath(NFCONF_FILE, S_IFREG) == PATH_NOTEXISTS) {
                                  ^~~~~~~
                                  S_ISREG ```
              
@thezoggy
Copy link
Contributor

1.7.3 compiles fine here..

what i do is:

git pull
./autogen.sh
./configure --enable-nfprofile --enable-maxmind --enable-readpcap --enable-nfpcapd --enable-sflow
make
sudo make install
sudo ldconfig

whats your configure line?
and do you have /usr/local/etc/nfdump.conf ?

@fourjay
Copy link
Author

fourjay commented Sep 21, 2023

my configure is a pretty simple --enable-sflow
I've also tried it with no ./configure options, with the same result.
As mentioned v1.7.2 compiles fine.

Does compiling somehow reference the application config (that seems really, really, odd)

I just made another attempt, with the same failure:
make distclean
sh autogen.sh
./configure
make

I'm running it on opensuse leap 15.5 (latest)
It has
automake (GNU automake) 1.15.1

@phaag
Copy link
Owner

phaag commented Sep 25, 2023

@fourjay - what OS/version are you using?

@phaag
Copy link
Owner

phaag commented Sep 25, 2023

Ahh - sorry, I see - opensuse.

I have no opensuse, but I would expect S_IFREG should be defined in /usr/include/sys/stat.h with C standard C99 and later as any other Linux does. Could you check, where opensuse lacks some headers or infos?

@fourjay
Copy link
Author

fourjay commented Sep 25, 2023

Thank you.

This looks OK (to my untrained eye).
/usr/include/sys/stat.h
exists, and there is a define line for S_IFREG
FWIW glibc is at 2.31

To that end, here are a few more lines preceding the failure.

make[3]: Entering directory '/usr/local/src/nfdump/fortier/src/lib'
depbase=`echo conf/nfconf.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../..  -I.. -I../include -I../inline -Iconf -Icompress   -ggdb  -g -O3 -std=c99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing -pthread 
-MT conf/nfconf.lo -MD -MP -MF $depbase.Tpo -c -o conf/nfconf.lo conf/nfconf.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -I.. -I../include -I../inline -Iconf -Icompress -ggdb -g -O3 -std=c99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing -pthread -MT conf/nfconf.lo -MD -MP -MF con
f/.deps/nfconf.Tpo -c conf/nfconf.c  -fPIC -DPIC -o conf/.libs/nfconf.o

Is it possible there's an include that's missing?

@fourjay
Copy link
Author

fourjay commented Sep 25, 2023

Looking at the working compile on my machine (v1.7.2) it looks like the use of libtool is new for v.1.7.3?
V1.7.2 for the same subdirectory (nfconf)
invokes GCC directly.

depbase=`echo nfconf.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\                                                                             
gcc -DHAVE_CONFIG_H -I. -I../..  -I.. -I../include -I../lib  -DCONFIGDIR=\"/usr/local/etc\"   -g -O3 -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing -pthread -MT nfconf.o -MD -MP -MF $depbase.Tpo -c -o
 nfconf.o nfconf.c &&\                    
mv -f $depbase.Tpo $depbase.Po           
depbase=`echo toml.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\                                                                               
gcc -DHAVE_CONFIG_H -I. -I../..  -I.. -I../include -I../lib  -DCONFIGDIR=\"/usr/local/etc\"   -g -O3 -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing -pthread -MT toml.o -MD -MP -MF $depbase.Tpo -c -o t
oml.o toml.c &&\                          
mv -f $depbase.Tpo $depbase.Po             
rm -f libconf.a                                                                                                                          
ar cru libconf.a nfconf.o toml.o 
ranlib libconf.a                  
make[2]: Leaving directory '/usr/local/src/nfdump/fortier/src/conf'

@phaag
Copy link
Owner

phaag commented Sep 26, 2023

I installed a virtual opensuse to test. Here is how it works:

CFLAGS='-D__USE_MISC' ./configure ..

or use clang to compile:

sudo zypper install clang and then a typical ./configure

@fourjay
Copy link
Author

fourjay commented Sep 26, 2023

Thank you so much. clang worked as expected

@phaag phaag closed this as completed Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants