PurpleI2P / i2pd

🛡 I2P: End-to-End encrypted and anonymous Internet
https://i2pd.website
BSD 3-Clause "New" or "Revised" License
3.27k stars 424 forks source link

OS X Error #65

Closed iShift closed 10 years ago

iShift commented 10 years ago

MacBook-Pro:i2pd Shift$ make -j 2 mkdir -p obj g++ -o obj/i2p.o i2p.cpp -c -g -Wall -std=c++0x g++ -o obj/base64.o base64.cpp -c -g -Wall -std=c++0x g++ -o obj/NTCPSession.o NTCPSession.cpp -c -g -Wall -std=c++0x NTCPSession.cpp:5:10: fatal error: 'cryptopp/dh.h' file not found

include <cryptopp/dh.h>

     ^

i2p.cpp:7:10: fatal error: 'cryptopp/integer.h' file not found

include <cryptopp/integer.h>

     ^

1 error generated. make: * [obj/NTCPSession.o] Error 1 make: * Waiting for unfinished jobs.... 1 error generated. make: *\ [obj/i2p.o] Error 1

orignal commented 10 years ago

You must build and install crypto++ first

iShift commented 10 years ago

after install

g++ -o obj/i2p.o i2p.cpp -c -g -Wall -std=c++0x In file included from i2p.cpp:18: In file included from ./Transports.h:12: In file included from ./NTCPSession.h:12: ./I2NPProtocol.h:127:20: error: use of undeclared identifier 'htobe32' header->msgID = htobe32 (msgID); ^ ./I2NPProtocol.h:128:34: error: use of undeclared identifier 'be32toh' header->expiration = htobe64 (be32toh (ssu.short... ^ ./I2NPProtocol.h:129:19: error: use of undeclared identifier 'htobe16' header->size = htobe16 (len - offset - sizeof (I... ^ ./I2NPProtocol.h:137:36: error: use of undeclared identifier 'be64toh' ssu->shortExpiration = htobe32 (be64toh (header.... ^ ./I2NPProtocol.h:138:46: error: use of undeclared identifier 'be16toh' ...len = offset + sizeof (I2NPHeaderShort) + be16toh (header.size); ^ ./I2NPProtocol.h:139:11: error: use of undeclared identifier 'be32toh' return be32toh (header.msgID); ^ In file included from i2p.cpp:24: In file included from ./HTTPServer.h:8: ./Streaming.h:48:46: error: use of undeclared identifier 'be32toh' uint32t GetSendStreamID () const { return be32toh ((ui... ^ ./Streaming.h:49:49: error: use of undeclared identifier 'be32toh' uint32t GetReceiveStreamID () const { return be32toh (... ^ ./Streaming.h:50:38: error: use of undeclared identifier 'be32toh' uint32t GetSeqn () const { return be32toh ((uint32_t *... ^ ./Streaming.h:51:44: error: use of undeclared identifier 'be32toh' uint32t GetAckThrough () const { return be32toh ((uint... ^ ./Streaming.h:54:39: error: use of undeclared identifier 'be16toh' uint16t GetFlags () const { return be16toh ((uint16_t ... ^ ./Streaming.h:55:44: error: use of undeclared identifier 'be16toh' uint16t GetOptionSize () const { return be16toh ((uint... ^ In file included from i2p.cpp:18: In file included from ./Transports.h:12: In file included from ./NTCPSession.h:10: In file included from ./Identity.h:6: ./ElGamal.h:54:9: warning: private field 'm_ZeroPadding' is not used [-Wunused-private-field] bool m_ZeroPadding;
^ 1 warning and 12 errors generated. make: *\ [obj/i2p.o] Error 1

orignal commented 10 years ago

Please look at the file I2PEndian.h

elif MACH // Mac OS X

include machine/endian.h

what is correct definition and location for new Mac OS X (this one is for old PPC)

iShift commented 10 years ago

/usr/include/machine/endian.h http://stackoverflow.com/questions/20813028/endian-h-not-found-on-mac-osx

iShift commented 10 years ago

i think, what we can forget about PPC macs.

orignal commented 10 years ago

Unfortunally, that's only Mac OS X I have available right now

iShift commented 10 years ago

try hacintosh in virtual box/vmware

orignal commented 10 years ago

/usr/include/machine/endian.h

Than I don't understand what's wrong. You should look inside that file. Or comment out these 2 lines and use windows implementation

orignal commented 10 years ago

try hacintosh in virtual box/vmware

Don't have a box with Intel. Doesn't work at my Amd

meeh420 commented 10 years ago

orignal: Maybe my patch was a better approach? It's working on 10.9/10.7.5 here!

orignal commented 10 years ago

The source of problem is "machine/endian.h" doesn't contain all necessary functions. I used own implementation from I2PEndian.h. Beside this everything works well. Your patch should work as well.

meeh420 commented 10 years ago

As far as I know about OSX, the diffrence is that I fetch similar funtions from the Cocoda library or what it was named instead of darwin's posix implementation. :)

orignal commented 10 years ago

Btw, have you tried AES-NI at OS X?

mikalv commented 10 years ago

Yes, in fact I compiled with it. (Meeh, dayjob/work -account)

See,

i2pd$ make -f Makefile-osx -j6 
grep: /proc/cpuinfo: No such file or directory
g++ -o obj/SSU.o SSU.cpp -c -g -Wall -std=c++11 -lstdc++ -DCRYPTOPP_DISABLE_ASM -DAESNI
g++ -o obj/SSUData.o SSUData.cpp -c -g -Wall -std=c++11 -lstdc++ -DCRYPTOPP_DISABLE_ASM -DAESNI
clang: clang: warning: warning: -Z-reserved-lib-stdc++: 'linker' input unused-Z-reserved-lib-stdc++: 'linker' input unused

In file included from SSUData.cpp:2:
In file included from ./SSU.h:12:
In file included from ./Identity.h:6:
./ElGamal.h:54:9: warning: private field 'm_ZeroPadding' is not used [-Wunused-private-field]
                        bool m_ZeroPadding;     
                             ^
In file included from SSU.cpp:8:
In file included from ./RouterContext.h:7:
In file included from ./Identity.h:6:
./ElGamal.h:54:9: warning: private field 'm_ZeroPadding' is not used [-Wunused-private-field]
                        bool m_ZeroPadding;     
                             ^
1 warning generated.
1 warning generated.
g++ -o i2p obj/CryptoConst.o obj/base64.o obj/NTCPSession.o obj/RouterInfo.o obj/Transports.o obj/RouterContext.o obj/NetDb.o obj/LeaseSet.o obj/Tunnel.o obj/TunnelEndpoint.o obj/TunnelGateway.o obj/TransitTunnel.o obj/I2NPProtocol.o obj/Log.o obj/Garlic.o obj/HTTPServer.o obj/Streaming.o obj/Identity.o obj/SSU.o obj/util.o obj/Reseed.o obj/UPnP.o obj/TunnelPool.o obj/HTTPProxy.o obj/AddressBook.o obj/Daemon.o obj/DaemonLinux.o obj/SSUData.o obj/i2p.o obj/aes.o -Wl,-rpath,/usr/local/lib -lcryptopp -lboost_system -lboost_filesystem -lboost_regex -lboost_program_options -lpthread 
mikal@mikalv:~/repos/git/i2pd$ 
iShift commented 10 years ago

Теперь всё собирается, только не может найти маршрут до хостов (LeaseSet requested No outbound tunnels found)

orignal commented 10 years ago

Не может тоннели построить - надо смотреть почему. Возможно то же самое что и здесь https://github.com/orignal/i2pd/issues/75

iShift commented 10 years ago

Все работает) просто нужно было время, тачка за корпоративным натом

orignal commented 10 years ago

Если за натом, то все равно будет работать хреново. Я ту часть чтобы он догадывался что за натом и объявлял себя соотвествующим образом еще не доделал.