Building Linux and FLOSS programs from source code

There is a debate about installing python’s internal packages with pip versus with the package system. I guess you dont have a package system yet, so no choice.

Try a reinstall. You need to source a manure package, and download it.

1 Like

BOY!!! That sounds like some hot, smelly WORK!!!
Just exactly, what is Ninja!!!

1 Like

I had to look it up

Sounds like it operates inside of Cmake?
Why do they make these build things so complicated?
All you need is a compiler, and some way of having all the necessary bits present.

1 Like

Well, some OSs differ in certain ways. It would be great to automate the configuration of the build.

2 Likes

I don’t believe CMake is a firm requirement for ninja. Some projects are choosing ninja for speed. It also allows for building parts in parallel. There is a C alternative to ninja called samurai: GitHub - michaelforney/samurai: ninja-compatible build tool written in C

2 Likes

Slackware leaves dependency management to the user. I like to control what dependencies I need to build my packages. I list which dependencies I use as part of the package related information. I can use the list as input to build those packages in order. I also have lists of packages in an order that I know works when building those packages and meets the dependencies I want to use. I can give the list to the build tools and have it build them in order. If there’s an error along the way, it logs any issues.

Perhaps a better idea and more of a challenge would be to develop something based on next os

That is basically what I do building R. Configure helps by finding missing dependencies but I control installing them.

Some packages have optional inclusion of certain libraries… eg do you want tiff image support. It is a bit more than leaving out a library, you have to tell the source not to call it.

There are other issues like which C and Fortran compilers and which flags for them.
I usually do that in the Makefile(s)

Do you mean this?

It seems to not be the original Steve Jobs Next… I think Apple own that

1 Like

I thought développement stopped when steve returned to apple

It did. That link may be someting entirely different.
Anyway, if your suggestion is to come to anything, there has to be source code access.
That is what I went looking for when I found the above link.

1 Like

Having looked further at the git hub site I dont think it is connected to next original and not much has taken place on it, suspect it is dead in the water.

But may not be a project for the faint hearted

1 Like

I thought there might be a free version of Next OS but I’m not finding it at the moment. OS Dev wiki has lists of alternative operating systems (not Linux). Wikipedia mentioned GNUstep as a Free alternative to NeXTSTEP.

1 Like

@nevj @Laura_Michaels
I am in need of “you two” to teach me on the use of “$PATH”!!!
The reason, is because I had a couple of Mesa dependencies “Cbindgen-0.28.0 and rust-bindgen-0.71.1” that installed with “cargo build --release” and the cargo command was missing. Come to find out I had to set a “PATH” to “/opt/rustc/bin” with the “export PATH=”
command. Why is this and why does this happen?

1 Like

Its quite worrying that its now 35 years old … looking back at my next machine at that time … i must not have been born … in my head I am still 21 but my shoes tell me I am 7 and a half which I would suspect my wife would agree with.

3 Likes

To run an executable at a command line without having to specify the entire path of the executable, the shell (or command.com on DOS or Windows) checks every directory listed for the PATH variable. It checks if the executable is in any of these directories. If not, it fails to find the executable and won’t run it. So, if you’re just trying to run the program cargo without specifying where it is (specifying /opt/rustc/bin/cargo), it won’t find it. By adding the directory to the PATH, it can then find and run your executable without specifying where it is. You’d want to add a new directory to a path using something similar to export PATH=“$PATH:/opt/rustc/bin” That way, you don’t lose the rest of the directories you’re already checking and end up with other commands not working. Only certain shells such as bash or ash use export. Some shells use other commands such as setenv for csh or tcsh. According to the FHS, the /opt directory is used for add-on packages which are not part of a standard distribution. Typically, binaries are installed in /usr/bin or, if you’re personally building from source and installing (and not doing a project similar to LFS), in /usr/local/bin. See the FHS document for more details on what goes where.

3 Likes

Laura has explained how to manage $PATH beautifully.
Can I just add this
When a package is installed, the install script or command should check that the directory where it places the binary(s) is in the default $PATH, and if not it should add it.. Lots of package installs do not do this, so the user has to modify $PATH. Cargo is apparently one of these lazy installs that omit fixing the path.

You have a choice

  • there is a default $PATH that is defined in /etc and it is what each user is set up with when the user is created…you can modify that and all users will get the modification, or
  • you can add to the default $PATH which you as a user received, as inidicated by Laura. That is typically done in ~/.bashrc. This way will only change it for one user. Root has its own $PATH defined in root’s home directory, so if you are operating as root you need to change it in /root

Need more details?
https://unix.stackexchange.com/questions/227989/complete-view-of-where-the-path-variable-is-set-in-bash

2 Likes

Where is “PATH” set in /root/

There should be a .bashrc file in /root
You can set it there. and it will apply to all shells owned by root.

Remember to use
export PATH=“$PATH:/opt/rustc/bin”
as explained by Laura
so that it appends your new path to the default path that root inherits

When you first set it, you need to do
source .bashrc
to activate it for the current shell.

3 Likes

There’s also /etc/environment … That works on Debian / Ubuntu, and RHEL/Oracle/Fedora… No idea about LFS or other Linux…
I’ve used that often in the past - e.g. to set a systemwide proxy…

1 Like