Building from source

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Building from source

Chris Zakelj
Coming back to my self-teaching on how to (hopefully eventually) be
semi-competent, I'm working on trying to build a git project from
source.  Thus far I've been able to figure out things like functions
having slight name differences (e.g. |pthread_set_name_np()| instead of
|pthread_setname_np()) and missing #includes in .hh files, but getting
stuck on a library issue... about halfway through the first module, I'm
failing with:

ld: error: unable to find library -lprotoc
ld: error: unable to find library -lprotobuf
c++: error: linker command failed with exit code 1 (use -v to see
invocation)

I've pkg_add'ed the necessary packages, and the libraries exist in
/usr/local/lib.  I found one site that suggested creating a softlink
from .so to .so.9.0 in case the linker didn't understand versioning, but
that didn't help. Read the .mk files in /usr/share/mk but nothing jumped
out as obvious, and /etc/mk.conf doesn't exist. Pretty sure I'm missing
something newbie-obvious, I just don't know what, so a kind "Look
here..." would be appreciated.

|

Reply | Threaded
Open this post in threaded view
|

Re: Building from source

Bodie-3


On 17.12.2020 03:07, Chris Zakelj wrote:
> Coming back to my self-teaching on how to (hopefully eventually) be
> semi-competent, I'm working on trying to build a git project from
> source.  Thus far I've been able to figure out things like functions
> having slight name differences (e.g. |pthread_set_name_np()| instead of
> |pthread_setname_np()) and missing #includes in .hh files, but getting
> stuck on a library issue... about halfway through the first module, I'm
> failing with:
>

Will be nice to know which code/project as maybe someone else work on
that too

> ld: error: unable to find library -lprotoc
> ld: error: unable to find library -lprotobuf
> c++: error: linker command failed with exit code 1 (use -v to see
> invocation)
>

https://www.openbsd.org/report.html

There are for sure other places with more info regarding that. Maybe
related Makefile is "hardcoded" with paths which are different on
OpenBSD.
It offers at least hint to use -v for how it was invoked

> I've pkg_add'ed the necessary packages, and the libraries exist in
> /usr/local/lib.  I found one site that suggested creating a softlink
> from .so to .so.9.0 in case the linker didn't understand versioning,
> but
> that didn't help. Read the .mk files in /usr/share/mk but nothing
> jumped
> out as obvious, and /etc/mk.conf doesn't exist. Pretty sure I'm missing
> something newbie-obvious, I just don't know what, so a kind "Look
> here..." would be appreciated.
>
> |

You can create /etc/mk.conf on your own with stuff you need. Maybe you
can
try to follow https://www.openbsd.org/faq/ports/guide.html as these
things
are handled on that level and there are tools present like look for
'make port-lib-depends-check'

Verify shared library dependencies. Run make port-lib-depends-check and
add every LIB_DEPENDS or WANTLIB annotation that is needed until it runs
cleanly. You may want to read the update guidelines to understand why
this is so important.

Or section Known your software, ports(7) and so on. There is too much to
read on the start doing it first time however.

Reply | Threaded
Open this post in threaded view
|

Re: Building from source

Stuart Henderson
In reply to this post by Chris Zakelj
On 2020-12-17, Chris Zakelj <[hidden email]> wrote:

> Coming back to my self-teaching on how to (hopefully eventually) be
> semi-competent, I'm working on trying to build a git project from
> source.  Thus far I've been able to figure out things like functions
> having slight name differences (e.g. |pthread_set_name_np()| instead of
>|pthread_setname_np()) and missing #includes in .hh files, but getting
> stuck on a library issue... about halfway through the first module, I'm
> failing with:
>
> ld: error: unable to find library -lprotoc
> ld: error: unable to find library -lprotobuf
> c++: error: linker command failed with exit code 1 (use -v to see
> invocation)

You need -L/usr/local/lib on linker commands. This is often done by
setting it in LDFLAGS when running any configure scripts.


Reply | Threaded
Open this post in threaded view
|

Re: Building from source

Nemo Nusquam
On 12/17/20 04:28, Stuart Henderson wrote:
> On 2020-12-17, Chris Zakelj <[hidden email]> wrote (in part):
>> Coming back to my self-teaching on how to (hopefully eventually) be
>> semi-competent, I'm working on trying to build a git project from
>> source.
> You need -L/usr/local/lib on linker commands. This is often done by
> setting it in LDFLAGS when running any configure scripts.
You will find that many, many projects were developed on Linux only so
that the scripts and Makefiles are full of bashisms and Linux-specific
environments (hence Stuart's comment).  Persevere and good luck.

Reply | Threaded
Open this post in threaded view
|

Re: Building from source

Chris Zakelj
In reply to this post by Bodie-3
Sorry about taking so long to get back to this... 'tis just a side
project to stave off boredom while sitting in hotel rooms with nothing
"real job" related remaining to get done.

On 12/16/2020 11:34 PM, Bodie wrote:

> On 17.12.2020 03:07, Chris Zakelj wrote:
>> Coming back to my self-teaching on how to (hopefully eventually) be
>> semi-competent, I'm working on trying to build a git project from
>> source.  Thus far I've been able to figure out things like functions
>> having slight name differences (e.g. |pthread_set_name_np()| instead of
>> |pthread_setname_np()) and missing #includes in .hh files, but getting
>> stuck on a library issue... about halfway through the first module, I'm
>> failing with:
>
> Will be nice to know which code/project as maybe someone else work on
> that too

It's a stand-alone torrent tracker called hefur:
https://github.com/abique/hefur
(I'm trying to get this working since it has a much better statistics
and control mechanism than OpenTracker)

> https://www.openbsd.org/report.html
This is definitely not report-worthy... at least until I've truly
exhausted the relevant reading material.

> There are for sure other places with more info regarding that. Maybe
> related Makefile is "hardcoded" with paths which are different on OpenBSD.
> It offers at least hint to use -v for how it was invokedNemo's response suspects there would be "I'm running on Linux"
assumptions in a couple of places, and while I haven't seen anything
"obvious" to that effect so far, the fact that it uses CMake in itself
does point in that direction.

> You can create /etc/mk.conf on your own with stuff you need. Maybe you can
> try to follow https://www.openbsd.org/faq/ports/guide.html as these things
> are handled on that level and there are tools present like look for
> 'make port-lib-depends-check'
I suspect this would be where Stuart's "-L/usr/local/lib" should live...
back to the reading and experimenting!