LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   FreeBSD: compiling outside port tree (https://www.linuxquestions.org/questions/%2Absd-17/freebsd-compiling-outside-port-tree-4175430147/)

Kropotkin 10-02-2012 03:35 PM

FreeBSD: compiling outside port tree
 
Hi all,

I've compiled countless ports in the FreeBSD /usr/port tree, as well as packages under Linux which were not available through package managers such as apt or yum. But I've never compiled anything outside the FreeBSD port tree.

I see something on GitHub I'd like to run: https://github.com/Grive/grive

Can I simply unpack it and run ./configure --prefix=/usr/local or are there also other considerations?

I am not asking about dependencies: these are clearly indicated:
Quote:

You need the following libraries:

- json-c
- libcurl
- libstdc++
- libgcrypt
- Boost (Boost filesystem and program_option are required)

There are also some optional dependencies:
- CppUnit (for unit tests)
- libbfd (for backtrace)
- binutils (for libiberty, required for compilation in OpenSUSE & ubuntu)
TIA

ocicat 10-05-2012 02:07 PM

Quote:

Originally Posted by Kropotkin (Post 4795390)
I see something on GitHub I'd like to run: https://github.com/Grive/grive

Can I simply unpack it and run ./configure --prefix=/usr/local or are there also other considerations?

First of all, I don't run FreeBSD, but I am conversant enough in other members of the *BSD family to give you the correct answer.

In a perfect world, code could be compiled on any platform, & it would magically execute as expected.

However, this isn't a perfect world. POSIX attempts to identify the lowest common denominator which should be portable on all POSIX-compliant systems, but software found in the wild has rapidly become Linux-centric, & Unix-like platforms support POSIX to varying degrees . Developers are increasingly devaluing the importance of being cross-compatible.

Consider this. Not all libraries available on Linux will be found on the *BSD family nor Solaris. Different libraries may exist which provide similar capabilities, but not in a compatible manner. You should also compare the hier(7) manpages between Linux & FreeBSD. You will find that they are not identical.

The results of all of this is that software found in the wild today will more probably run on Linux with no changes, but you will likely need to study the source & possibly figure out what patches need to be applied in order to run on FreeBSD. This is one of the values of FreeBSD's officially sanctioned ports tree. Someone else has already gone through the grief of figuring this out before, & the process has since been automated.

So to answer your original question, maybe code found on GitHub will compile without changes on FreeBSD, but experience points out that this is likely an unrealistic expectation. The definitive answer is to simply try it yourself & see.

Kropotkin 10-06-2012 02:55 AM

Thanks for the helpful feedback. I ran into some ugly compile errors with Boost, so I am temporarily flummoxed ;)

ocicat 10-08-2012 01:08 PM

Quote:

Originally Posted by Kropotkin (Post 4798624)
I ran into some ugly compile errors with Boost, so I am temporarily flummoxed ;)

Obviously, it would be easier to simply install the port.

However if you really want to learn, you could build the port to see what has been done before you (by studying the Makefile & whatever patches are necessary...) to get Boost to install.


All times are GMT -5. The time now is 08:35 PM.