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

build libov for all platforms #10

Open
gisogrimm opened this issue Aug 22, 2020 · 1 comment
Open

build libov for all platforms #10

gisogrimm opened this issue Aug 22, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@gisogrimm
Copy link
Owner

libov should contain the core interface library. It has minimal dependencies and should build on most platforms (network tools may require specific implementations).

@alessandrostone
Copy link
Contributor

libov

Hi guys :)

Compiling libov on osx needs to cut -fext-numeric-literals at least on my machine (mbp 2015 running High Sierra); not sure if that is a strict requirement to use this flag, as it appears to be C++14: if thats the case I need to find another way.

cutting cut -fext-numeric-literals Libov compiles with just a warning on osx:

 /Volumes/M/U/a/Doc/DIG/OV/libov  master !1  make                                                                       ✔ 
mkdir -p build
touch build/.directory
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/ov_types.cc -o build/ov_types.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/errmsg.cc -o build/errmsg.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/common.cc -o build/common.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/udpsocket.cc -o build/udpsocket.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/callerlist.cc -o build/callerlist.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/ovboxclient.cc -o build/ovboxclient.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/MACAddressUtility.cc -o build/MACAddressUtility.o
src/MACAddressUtility.cc:102:9: warning: variable 'intfService' is uninitialized when used here [-Wuninitialized]
  while(intfService == IOIteratorNext(intfIterator)) {
        ^~~~~~~~~~~
src/MACAddressUtility.cc:92:26: note: initialize the variable 'intfService' to silence this warning
  io_object_t intfService;
                         ^
                          = 0
1 warning generated.
ar rcs build/libov.a build/ov_types.o build/errmsg.o build/common.o build/udpsocket.o build/callerlist.o build/ovboxclient.o build/MACAddressUtility.o
 /Volumes/M/U/a/Doc/DIG/OV/libov  master !1  make                                                                  ✔  4s 
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/MACAddressUtility.cc -o build/MACAddressUtility.o
ar rcs build/libov.a build/ov_types.o build/errmsg.o build/common.o build/udpsocket.o build/callerlist.o build/ovboxclient.o build/MACAddressUtility.o

make after adding initialization to intfService

Just adding initialization to

io_object_t intfService = 0;

let it compiles just fine:

 /Volumes/M/U/a/Doc/DIG/OV/libov  master !1  make clean                                                                 ✔ 
rm -Rf build src/*~
 /Volumes/M/U/a/Doc/DIG/OV/libov  master !1  make                                                                       ✔ 
mkdir -p build
touch build/.directory
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/ov_types.cc -o build/ov_types.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/errmsg.cc -o build/errmsg.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/common.cc -o build/common.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/udpsocket.cc -o build/udpsocket.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/callerlist.cc -o build/callerlist.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/ovboxclient.cc -o build/ovboxclient.o
g++ -Wall -Wno-deprecated-declarations -std=c++11 -pthread -ggdb -fno-finite-math-only -DOVBOXVERSION="\"0.3\"" -D OSX -D IA32 -c src/MACAddressUtility.cc -o build/MACAddressUtility.o
ar rcs build/libov.a build/ov_types.o build/errmsg.o build/common.o build/udpsocket.o build/callerlist.o build/ovboxclient.o build/MACAddressUtility.o

Not sure if this can affect anything else, if we shall flag the file as not to check uninitialized or I shall just push the initialized version.

Even using -D IA32 this outputs:

lipo -info build/libov.a Non-fat file: build/libov.a is architecture: x86_64

that is perfectly fine on this machine, but I am not sure what is the lower architecture for osx we want to support.

@gisogrimm gisogrimm added the enhancement New feature or request label Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants