Closed vm-001 closed 7 months ago
It seems that there is an error when compiling with clang. I tried to compile with clang on ubuntu, but the error did not appear. Please provide complete environment information, and then you can also try to compile with gcc.
I'm using MacOS(I tested both Intel and Apple CPU, both are not working). Not sure how to solve the luaclib/lfs.so.
Sorry, I don't have a macOS system and cannot attempt to solve it. If you are interested, I hope you can help me solve it. Thank you very much!
6148e97c8e470583b143c96ebcfecebed6a7229f Please see if the latest modifications can solve your problem
I tried, and another error came out.
make macosx
cd skynet && /Applications/Xcode.app/Contents/Developer/usr/bin/make PLAT=macosx TLS_MODULE=ltls TLS_LIB=/usr/bin/openssl TLS_INC=/usr/include/openssl
/Applications/Xcode.app/Contents/Developer/usr/bin/make macosx
/Applications/Xcode.app/Contents/Developer/usr/bin/make all PLAT=macosx SKYNET_LIBS="-lpthread -lm -ldl" SHARED="-fPIC -dynamiclib -Wl,-undefined,dynamic_lookup" EXPORT="" MALLOC_STATICLIB="" SKYNET_DEFINES="-DNOUSE_JEMALLOC"
cc -g -O2 -Wall -I3rd/lua -o skynet skynet-src/skynet_main.c skynet-src/skynet_handle.c skynet-src/skynet_module.c skynet-src/skynet_mq.c skynet-src/skynet_server.c skynet-src/skynet_start.c skynet-src/skynet_timer.c skynet-src/skynet_error.c skynet-src/skynet_harbor.c skynet-src/skynet_env.c skynet-src/skynet_monitor.c skynet-src/skynet_socket.c skynet-src/socket_server.c skynet-src/malloc_hook.c skynet-src/skynet_daemon.c skynet-src/skynet_log.c 3rd/lua/liblua.a -Iskynet-src -I3rd/jemalloc/include/jemalloc -lpthread -lm -ldl -DNOUSE_JEMALLOC
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup service-src/service_snlua.c -o cservice/snlua.so -Iskynet-src
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup service-src/service_logger.c -o cservice/logger.so -Iskynet-src
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup service-src/service_gate.c -o cservice/gate.so -Iskynet-src
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup service-src/service_harbor.c -o cservice/harbor.so -Iskynet-src
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup lualib-src/lua-skynet.c lualib-src/lua-seri.c lualib-src/lua-socket.c lualib-src/lua-mongo.c lualib-src/lua-netpack.c lualib-src/lua-memory.c lualib-src/lua-multicast.c lualib-src/lua-cluster.c lualib-src/lua-crypt.c lualib-src/lsha1.c lualib-src/lua-sharedata.c lualib-src/lua-stm.c lualib-src/lua-debugchannel.c lualib-src/lua-datasheet.c lualib-src/lua-sharetable.c -o luaclib/skynet.so -Iskynet-src -Iservice-src -Ilualib-src
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup lualib-src/lua-clientsocket.c lualib-src/lua-crypt.c lualib-src/lsha1.c -o luaclib/client.so -lpthread
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup -Iskynet-src lualib-src/lua-bson.c -o luaclib/bson.so
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup -I3rd/lua-md5 3rd/lua-md5/md5.c 3rd/lua-md5/md5lib.c 3rd/lua-md5/compat-5.2.c -o luaclib/md5.so
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup -Ilualib-src/sproto lualib-src/sproto/sproto.c lualib-src/sproto/lsproto.c -o luaclib/sproto.so
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup -I3rd/lpeg 3rd/lpeg/lpcap.c 3rd/lpeg/lpcode.c 3rd/lpeg/lpprint.c 3rd/lpeg/lptree.c 3rd/lpeg/lpvm.c 3rd/lpeg/lpcset.c -o luaclib/lpeg.so
cc -g -O2 -Wall -I3rd/lua -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup -Iskynet-src -L/usr/bin/openssl -I/usr/include/openssl lualib-src/ltls.c -o luaclib/ltls.so -lssl
lualib-src/ltls.c:5:10: fatal error: 'openssl/err.h' file not found
#include <openssl/err.h>
^~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [luaclib/ltls.so] Error 1
make[2]: *** [macosx] Error 2
make[1]: *** [default] Error 2
make: *** [skynet/skynet] Error 2
Please install the OpenSSL library for the Mac system This is how the Ubuntu system is installed
apt-get install openssl
apt-get install libssl-dev
Cannot build on both Intel and Apple CPU on MacOSX