MatGB wrote:Specifically, there were no executables for freeorion, freeoriond or freeorionca. But, this was the first time I'd *ever* tried to compile something on Linux and I had no idea what Linux executables even looked like or where they were meant to be.
Well, okay. I will give you a little breakdown of the steps then.
Starting from the commands you used:
irectory to the directory called 'git'
e a dir
ectory called 'freeorion.build' inside the git directory.
irectory to the new created directory 'freeorion.build'
Create a (soft) symbolic l
k to the default directory of the freeorion source inside the freeorion.build directory.
A symbolic link is a transparent way to point a file/directory to another file/directory.
This is because freeorion expects all the data files at a certain place.
Instead you could copy the default directory into the freeorion.build directory, but then changes inside the default directory originated in the source wouldn't reflect inside the build directory.
Configure your build from the sources located inside ../freeorion.
This is a more complex step, as it does serveral steps
1. It creates the build system, which is by default 'make', you can choose other build systems and, for example create a build system based on Xcode (only on MacOSX) or Visual Studio (only on Windows).
2. It checks if all prerequisites are satisfied. This means that all libraries and programs used are installed.
3. It generates platform specific code files from template files. For example it creates the Version.cpp file by asking GIT what the version of currently checked out source code is.
As the name says, this would be the place to configure
you build, e.g. where to install the result, what library versions to use and so on. Most of the time no configuration is needed for FO.
This is where you actually compile the code into the FO executables and libraries. The -j3 parameter says that the make build system should try to run 3 jobs in parallel. As a rule of thumb you run as many jobs as you have processors/cores (or less if you need a processor/core for other purposes).
After a successful compile the executables 'freeorion', 'freeorionca' and 'freeoriond' are placed within the 'freeorion.build' directory. On unix-ish systems there is no file extension indicating that an executable is executable, but rather a file permission that indicates this. Also important to note is that you haven't installed the application yet (which doesn't prevent you from running it, though, but more later).
Here is a l
ting of my freeorion build directory:
Code: Select all
$ ls -l
drwxrwxr-x. 4 adrian adrian 4096 8. Mai 22:49 client
-rw-rw-r--. 1 adrian adrian 38490 7. Jun 22:54 CMakeCache.txt
drwxrwxr-x. 7 adrian adrian 4096 8. Jun 15:10 CMakeFiles
-rw-rw-r--. 1 adrian adrian 5821 4. Jun 17:52 cmake_install.cmake
-rw-r--r--. 1 adrian adrian 5952 7. Jun 22:54 CPackConfig.cmake
-rw-r--r--. 1 adrian adrian 5487 7. Jun 22:54 CPackSourceConfig.cmake
lrwxrwxrwx. 1 adrian adrian 25 11. Mai 20:26 default -> ../freeorion.git/default/
-rwxrwxr-x. 1 adrian adrian 6359107 8. Jun 15:10 freeorion
-rwxrwxr-x. 1 adrian adrian 3196517 8. Jun 15:10 freeorionca
-rwxrwxr-x. 1 adrian adrian 3666331 8. Jun 15:10 freeoriond
drwxrwxr-x. 5 adrian adrian 4096 7. Jun 22:54 GG
-rwxrwxr-x. 1 adrian adrian 10461276 8. Jun 15:10 libfreeorioncommon.so
-rw-rw-r--. 1 adrian adrian 23637040 5. Jun 15:07 libfreeorionparse.a
-rwxrwxr-x. 1 adrian adrian 6473240 8. Jun 15:09 libfreeorionparse.so
-rwxrwxr-x. 1 adrian adrian 238069 4. Jun 17:53 libGiGiSDL.so
-rwxrwxr-x. 1 adrian adrian 4299976 4. Jun 17:53 libGiGi.so
-rw-rw-r--. 1 adrian adrian 65960 7. Jun 22:54 Makefile
drwxrwxr-x. 3 adrian adrian 4096 7. Jun 22:54 parse
drwxrwxr-x. 3 adrian adrian 4096 7. Jun 22:54 server
The '-l' parameter tells ls that it should output the listing in tabular form. The first column, indicates the permissions of a file. Permissions are a whole chapter on it's own, so I skip that for now. The important part is the 'x', which means that the file is executable.
It was only after I'd messed around, including using sudo apt get to install the current Release version from the Ubuntu repo (which wasn't what I thought I was doing) that I had a vague idea what to look for and then reran Cmake then Make, this time, despite doing everything identically, it worked fine.
Now here comes the part that probably caused problems for you. When executing a command on the command line like 'ls' the shell searches certain directories for this executable and execute it if found. The directories search are controlled by the 'PATH' environment variable. However the current directory '.' is by default not in this search path (and should not be for security purposes).
This means even if I'm in the freeorion build directory and there is a freeorion executable and I run
the shell will respond with something along the lines:
or, if you have installed freeorion on the system it would run this installed version, but not the version you compiled.
But you can tell the shell to explicit run the executable inside the directory by typing in:
Which literally translates into "execute the file 'freeorion' inside the current directory (. is the shorthand for that)".
Given I've rerun the commands subsequently, will the old output still exist? If so, where do I look?
I was assuming that had save it somewhere. No, by default the only output by make and cmake is written to the console. This output is destroyed whenever you close the console.