-
Notifications
You must be signed in to change notification settings - Fork 4
Compile
- Go to ThirdParty folder and look at things like
*.version.txt
,
install these correspond version library to somewhere compiler can know. - Go to prefetch folder and check
README.md
,
install correspond version Qt to somewhere compiler can know. - If you want to run "collect minimal release of compiled binary" script, install correspond version python,
otherwize python is not necessary to install. - Build system depends on vscode,
download and put these vscode config to your workspace folder. - Rename c_cpp_propertiesExample.json to
c_cpp_properties.json
and modify path information inside. - Rename launchExample.json to
launch.json
and modify path information inside. - Open vscode, use build command (usually is Ctrl+Alt+B), select one of option you prefer.
Qt build all release
require python to success ("collect minimal release of compiled binary"),
or the last step will fail, but it is safe to ignore.
Find compiled binary in one of these folders:
prefetch\qpp\build-prefetch-Desktop_x86_windows_mingw4_8_2_32bit-Debug
prefetch\qpp\build-prefetch-Desktop_x86_windows_mingw4_8_2_32bit-Release
- ...
-
prefetch\qpp\Pack
("minimal release of compiled binary")
You need GCC 4.8.2
and Qt 4.8.7
.
Due to Linux distribution actual situation
- Only one version package is allowed to install at the same time
- A package can be dependency to other package
A dynamically linked binary does not likely to work across different distribution.
Therefore, static link everything is required, include GCC and Qt.
I do not recommend trying to compile old GCC on new Linux distribution.
For example, Fedora 37 ship with GCC 12.2.1
, and most likely compile GCC 4.8.2
will fail.
All the extra compile option tweak, or find old dependency,
may even compile dependency's dependency's dependency is waste of time.
You can spend three days and still failed to compile in the end.
Instead, go virtual box and install Fedora 21, the one ship with GCC 4.8.2
,
but will update to 4.9.2
after dnf upgrade
.
Compile GCC 4.8.2
with these steps, nice and easy.
https://gcc.gnu.org/wiki/InstallingGCC
- Download gcc https://ftp.gnu.org/gnu/gcc/gcc-4.8.2
https://gcc.gnu.org/install/download.html
https://gcc.gnu.org/releases.html
https://gcc.gnu.org/mirrors.html
https://www.gnu.org/prep/ftp.html - Set system proxy if needed
export http_proxy=http://<ip>:<port>/;export https_proxy=http://<ip>:<port>/
- Set wget download proxy if needed
nano ~/.wgetrc
use_proxy=yes
http_proxy=<ip>:<port>
https_proxy=<ip>:<port>
- Set dnf proxy if needed
sudo nano /etc/dnf/dnf.conf
proxy=http://<ip>:<port>
- Install dependency
sudo dnf install zlib-devel glibc glibc-devel glibc.i686 glibc-devel.i686
cd gcc-4.8.2
./contrib/download_prerequisites
- Switch to build folder
cd ..
mkdir build-gcc-4.8.2
cd build-gcc-4.8.2
- Tell where to install, for example
$HOME/program/GCC-4.8.2
install to program directory under home directory
$PWD/../gcc-4.8.2/configure LDFLAGS='--static' --enable-static --prefix=$HOME/<where to install>/GCC-4.8.2 --enable-multilib --with-system-zlib --enable-lto --enable-languages=c,c++
- Compile
make -j <thread number>
make install
- Set environment variable to replace system gcc
export PATH=$HOME/<where to install>/GCC-4.8.2:$PATH
If you want ccache to accelerate the second time compile speed
put ccache in front of gcc and system$PATH
export PATH=<ccache install folder>:$PATH
- Document that still alive for read
https://het.as.utexas.edu/HET/Software/html/requirements-x11.html
https://het.as.utexas.edu/HET/Software/html/install-x11.html - Download Qt https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.zip
https://download.qt.io/archive/qt/4.8/4.8.7/ - Install dependency
sudo dnf install fontconfig-devel freetype-devel libX11-devel libXcursor-devel libXext-devel libXfixes-devel libXft-devel libXi-devel libXrandr-devel libXrender-devel
- Tell where to install, for example
$HOME/program/Qt/4.8.7
cd qt-everywhere-opensource-src-4.8.7
./configure -static --prefix=$HOME/<where to install>/Qt/4.8.7
- Compile
gmake -j <thread number>
gmake install
The rest is simple, install Qt Creator with sudo dnf install qt-creator
,
then open project prefetch_qt_creator_3_4_2.pro
,
configure it on GUI with GCC 4.8.2 and Qt 4.8.7 mentioned above.
Also check https://github.com/mhtvsSFrpHdE/prefetch/tree/master/qpp/prefetch#qmake-build-profile
to know how to build prefetch_performance
, prefetch_verbose
other than just prefetch
.
Compiled binary should be static and be able to copy and run on Fedora 37.
The prefetch.ini
and translate
folder is still needed to put together with binary.
In the meanwhile, drag compiled Qt to Fedora 37 will not work because you don't have old version
fontconfig-devel freetype-devel libX11-devel libXcursor-devel libXext-devel libXfixes-devel libXft-devel libXi-devel libXrandr-devel libXrender-devel
These option can either modify compile DEFINES or the file itself directly.
Disable a feature equal to delete related code, so they won't even appear in compiled EXE file,
instead of do if-else statement at runtime.
If you modified after build, you may need to delete exist build completely and rebuild.
Or the build system may not be able to detect changes.
https://github.com/mhtvsSFrpHdE/prefetch/raw/master/qpp/prefetch/Source/Define/define.h