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

some build issues on linux #271

Open
PinkMushroom opened this issue Apr 16, 2024 · 6 comments
Open

some build issues on linux #271

PinkMushroom opened this issue Apr 16, 2024 · 6 comments
Assignees

Comments

@PinkMushroom
Copy link

Trying to build this on linux and have found some problems.

First the clone command on the front page

git clone git@github.com:nam20485/OdbDesign.git

doesn't work

Cloning into 'OdbDesign'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Looking at that more closely I think it's just using a format assuming that you are accessing using an account ? Just pointing it out because I'm assuming a lot of people, like me, are just going to cut and paste that line ;-)

the standard git clone command using the link generated by github does work

git clone https://github.com/nam20485/OdbDesign.git

Then the real problem, the cmake command lines don't work

$ cmake --build --preset linux-release
Error: ./OdbDesign/out/build/linux-release is not a directory

It sure seems like it expects a linux-release library to be there, which it does not appear to be. I also searched the tree to make sure it wasn't hidden in a subdirectory and couldn't find it.

I'd really like to offer the solution but I'm not familiar with cmake at all.

Finally, it's not clear if docker is required if you are simply going to write C++ code which uses this library, i.e. Docker isn't needed to build it, is that correct ?

@nam20485
Copy link
Owner

nam20485 commented Apr 20, 2024

@PinkMushroom Thanks for reporting these issues!

the standard git clone command using the link generated by github does work
git clone https://github.com/nam20485/OdbDesign.git

I'll change the README to use the working git clone command.

$ cmake --build --preset linux-release
Error: ./OdbDesign/out/build/linux-release is not a directory

It looks like you didn't run the $cmake --preset linux-release command prior to running your cmake --build ... command.

Can you try that and report back if it works or any issues you encounter?

The full build instructions can be followed from the README.

But please make sure that you have followed the instructions to setup your build dependencies first! Or you will encounter some errors about missing dependencies.

Finally, it's not clear if docker is required if you are simply going to write C++ code which uses this library, i.e. Docker isn't needed to build it, is that correct ?

That is correct. There are two independent options:

  1. Build the shared library from source (as you are doing) and include it in your own C++ program.
  2. Skip all that and run the REST API server via the docker-compose commands.

I will add something to the README to make that more clear.

If you don't want to build from source, the built binaries for the shared library are included in the releases section.

@nam20485 nam20485 self-assigned this Apr 20, 2024
@nam20485
Copy link
Owner

nam20485 commented Apr 22, 2024

README updated to resolve these issues also. See associated issue #273

@PinkMushroom
Copy link
Author

PinkMushroom commented Apr 23, 2024

Thanks for your response.

oops, I had a bit of a reading fail. I find this confusing from the instructions

$ cmake --preset linux-debug
$ cmake --build --preset linux-release

So the preset builds the linux-debug target but then the build/preset builds linux-release ?
I would think the first command should be

cmake --present linux-release

and then further reading fail. Since vcpkg is a microsoft thing, I thought it was needed if you were building under windows. it looks as though I need to install it for Linux.

You may want to link to the vcpkg github repo.

https://github.com/microsoft/vcpkg?tab=readme-ov-file#quick-start-unix

The instructions on the microsoft page are not very useful if you are building on linux.

Unfortunately microsoft's instructions for install vcpkg on linux are quite bad. I'm going to have to admit defeat and stop there. If you were able to able to install vcpkg on linux I'm really impressed ! lol

If you don't want to build from source, the built binaries for the shared library are included in the releases section.

aha, that seems like a better idea than wrestling with install vcpkg.

8980848 2024-03-01 14:21 libOdbDesign.so
9197976 2024-03-01 14:21 libUtils.so
674152 2024-03-01 14:21 OdbDesignServer

so put lib*.so in /usr/lib or similar and enjoy OdbDesign programming ?

@nam20485
Copy link
Owner

nam20485 commented Apr 27, 2024

oops, I had a bit of a reading fail. I find this confusing from the instructions

$ cmake --preset linux-debug $ cmake --build --preset linux-release

So the preset builds the linux-debug target but then the build/preset builds linux-release ? I would think the first command should be

cmake --present linux-release

Oops, writing fail! You are correct. I have updated the README to fix that. Good find!

and then further reading fail. Since vcpkg is a microsoft thing, I thought it was needed if you were building under windows. it looks as though I need to install it for Linux.

You may want to link to the vcpkg github repo.

https://github.com/microsoft/vcpkg?tab=readme-ov-file#quick-start-unix

The instructions on the microsoft page are not very useful if you are building on linux.

Unfortunately microsoft's instructions for install vcpkg on linux are quite bad. I'm going to have to admit defeat and stop there. If you were able to able to install vcpkg on linux I'm really impressed ! lol

It's not that bad. I distilled the directions down to three steps. You can find them in the Build section of the README now.

If you don't want to build from source, the built binaries for the shared library are included in the releases section.

aha, that seems like a better idea than wrestling with install vcpkg.

8980848 2024-03-01 14:21 libOdbDesign.so
9197976 2024-03-01 14:21 libUtils.so
674152 2024-03-01 14:21 OdbDesignServer

so put lib*.so in /usr/lib or similar and enjoy OdbDesign programming ?

Yes, and you need to link your program to the library. Standard shared library linking can be found on the internet.

@PinkMushroom
Copy link
Author

Yes, and you need to link your program to the library. Standard shared library linking can be found on the internet.

That I know how to do :-)

Thank you for your help !

@nam20485
Copy link
Owner

Great! Thanks again for trying out the project.

Let me know if you run into any issues and I can help out.

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

2 participants