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

compile on Ubuntu 18.04 #14

Closed
lavarok opened this issue Dec 18, 2019 · 10 comments
Closed

compile on Ubuntu 18.04 #14

lavarok opened this issue Dec 18, 2019 · 10 comments

Comments

@lavarok
Copy link

lavarok commented Dec 18, 2019

command: make all-srv-lnx

Gets to here and fails:

[CC] lnx/x86_64 p2p/./openvpn3/client/ovpncli.cpp
p2p/./openvpn3/client/ovpncli.cpp:24:10: fatal error: 'iostream' file not found
#include
^~~~~~~~~~
1 error generated.
env/output.mk:146: recipe for target 'out-lnx/x86_64/./p2p/./openvpn3/client/ovpncli.cpp.o' failed
make[1]: *** [out-lnx/x86_64/./p2p/./openvpn3/client/ovpncli.cpp.o] Error 1

What am I missing?

@nhandler
Copy link
Collaborator

Can you try following the instructions on https://github.com/OrchidTechnologies/orchid/blob/master/srv-shared/README.md to see if that helps?

@lavarok
Copy link
Author

lavarok commented Dec 19, 2019

I was able to get it compiled by following the additional steps:

  • uninstall all versions of clang other than "8".
  • symlink clang-8 to clang, clang++-8 to clang++, and clang-tidy-8 to clang-tidy
  • install g++-8
  • modify 2 mk files - see attached

orchid_diff.txt

A guide on where to go from here would be appreciated. I'm looking to setup at least one node with bandwidth for the network.

@trees-smoke
Copy link

I don't seem to get past the iostreams error unless I add cflags += -stdlib=libstdc++ to srv-shared/makefile

Then I run into './p2p/cppcoro/include/cppcoro/async_auto_reset_event.hpp:8:10: fatal error: 'experimental/coroutine' file not found'

@lavarok
Copy link
Author

lavarok commented Dec 19, 2019

I don't seem to get past the iostreams error unless I add cflags += -stdlib=libstdc++ to srv-shared/makefile

Then I run into './p2p/cppcoro/include/cppcoro/async_auto_reset_event.hpp:8:10: fatal error: 'experimental/coroutine' file not found'

The iostream error goes away when you install the appropriate g++ package for your clang version.

@trees-smoke
Copy link

Ah, k, I'm dumb. It was easier for me going to ubuntu 19.10 and following the https://github.com/OrchidTechnologies/orchid/blob/master/srv-shared/README.md after installing the clang, clang++, clang-tidy, libc++-dev, libc++abi-dev and it worked.
Thanks guys.

@Geri1590
Copy link

Geri1590 commented Feb 9, 2020

Ah, k, I'm dumb. It was easier for me going to ubuntu 19.10 and following the https://github.com/OrchidTechnologies/orchid/blob/master/srv-shared/README.md after installing the clang, clang++, clang-tidy, libc++-dev, libc++abi-dev and it worked.
Thanks guys.

Hi there,
I'm trying to compile on Ubuntu 19.10, installing clang, clang++, clang-tidy, libc++-dev, libc++abi-dev as you said, and even though the previous errors are gone, now it shows a different one:

[LD] out-lnx/x86_64/orchidd
/usr/bin/ld: unrecognized option '--icf=all'
/usr/bin/ld: use the --help option for usage information
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Do you know why is that?
Thanks,

@zaniko
Copy link

zaniko commented Apr 11, 2020

Ah, k, I'm dumb. It was easier for me going to ubuntu 19.10 and following the https://github.com/OrchidTechnologies/orchid/blob/master/srv-shared/README.md after installing the clang, clang++, clang-tidy, libc++-dev, libc++abi-dev and it worked.
Thanks guys.

Hi there,
I'm trying to compile on Ubuntu 19.10, installing clang, clang++, clang-tidy, libc++-dev, libc++abi-dev as you said, and even though the previous errors are gone, now it shows a different one:

[LD] out-lnx/x86_64/orchidd
/usr/bin/ld: unrecognized option '--icf=all'
/usr/bin/ld: use the --help option for usage information
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Do you know why is that?
Thanks,

Hi,
Have you solved your problem ?

@dluman
Copy link

dluman commented Apr 15, 2020

I reproduced @Geri1590's issue on an install using Fedora 31. The issue lies with the compiler's use of ld; a different linker (lld) works in its place. You may need to restart the make process from the beginning using the following flags in the srv-shared/makefile:

cflags += -stdlib=libc++
cflags += -Qunused-arguments
cflags += -fuse-ld=ld.lld

wflags += -fuse-ld=lld

This changes the linked to use lld. I completed the build with clang-9, and needed to install dependencies libcxx,libcxx-devel, lld, and stand-up rust using the sh file which also installs rustup.

I encountered the same issues on other distros, so there may be something to a PR against the makefile?

@zaniko
Copy link

zaniko commented Apr 15, 2020

Yes I solved it too by deleting ld binary to be able to symlink lld binary to replace the original ld. This was the last error. Then the binary will be built

Edit : it’s a little dirty but works

Now the thing is how to use it. A lot of args have to be entered from reading the output of —help arg which don’t help me so much. Someone is running orchidd ?

@saurik
Copy link
Member

saurik commented Apr 18, 2020

When we compile orchidd for Linux, even when we do so on Linux, we do it as a cross-compile using debug=crossndk, in order to allow the resulting binary to run on older versions of Linux no matter where it was compiled (and also to get a more consistent build of the binary, as the goal is to have a fully deterministic and reproducible build). I thereby, honestly, just don't ever test "bare" / non-cross Linux compiles.

I've gone ahead and added a target orchid-lnx-bad to the GitHub CI in 2180fcd that does a non-cross build of Orchid using the system copy of clang (which of course must be 8 or above, probably 9; you can do this either by selecting the "alternative" with dpkg or setting suffix=-9) and fixed all of the resulting build errors. I will thereby be able to maintain this build going forward to make sure it does not break again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants