- Katılım
- 6 Mayıs 2022
- Konular
- 50,436
- Mesajlar
- 50,751
- Tepkime puanı
- 90
- M2 Yaşı
- 3 yıl 11 ay 28 gün
- Trophy Puan
- 48
- M2 Yang
- 510,404
Merhaba Arkadaşlar;
CCache ile derleme işlemini birçok kişi biliyor fakat nasıl kullanılacağına dair bir anlatım yok. Bu derleme metodu ccache kurduktan ilk dosyalarınızı normal sürede derlersiniz ve ccache derlediğiniz dosyaları önbelleğe kopyalar bu sayede diğer derlemelerinizi yaparken build süresi 10 dakika ise bu şekilde 1 dakikaya düşer.
CCache'de temizleme komutlarıda var bunlar;
Kurulum;
İşlem çok basit. Derleme yaptığınız sunucuya bağlanıyorsunu ve şu komutu giriyorsunuz;
Kurulumu yaptıktan sonra makefile dosyalarınızda düzenleme yapmamız gerekiyor. Makefile dosyalarınızca gcc sürümünüzü yazdığınız kısımın başına ccache ekliyoruz ve bu kadar başka bir işlem gerekmiyor. Bu işlemi tüm dosyalarınızdaki makefile dosyalarına eklemeniz gerekiyor örnek bir dosya görüntüsü;
Bu işlemi tüm dosyalarda yaptıktan sonra tek farklı işlem liblua klasöründe. Liblua klasöründeki config dosyası içine yazmanız gerekiyor ccache eklemesini o da şu şekilde;
FreeBSD'de CCache ile Hızlı Derleme: Kurulum ve Makefile Düzenlemeleri
FreeBSD sistemler üzerinde Metin2 sunucuları gibi büyük projeleri derlerken zaman kazanmak için ccache kullanımı oldukça faydalıdır. Bu makalede, FreeBSD ortamında ccache kurulumu, yapılandırması ve Makefile dosyalarında gerekli düzenlemeler nasıl yapılır detaylıca ele alınacaktır.
CCache Nedir?
Ccache (C/C++ compiler cache), derleme süreçlerinde aynı kod tekrar derleniyorsa, daha önce yapılan derleme çıktısını önbellekte tutarak tekrar derlemek yerine bu çıktıyı kullanarak hız kazandıran bir araçtır. Özellikle Metin2 gibi sürekli geliştirilen, kaynak kodları sık sık yeniden derlenen sistemlerde ccache sayesinde önemli zaman tasarrufu sağlanabilir.
FreeBSD Üzerine CCache Kurulumu
FreeBSD üzerinde ccache, hem ports hem de pkg sistemi ile kolayca kurulabilir. Tercihen root yetkisiyle aşağıdaki komutu çalıştırarak ccache'i yükleyin:
Alternatif olarak ports sistemini kullanmak isterseniz:
Yükleme tamamlandıktan sonra ccache komutunu doğrudan terminalden çağırabilmelisiniz.
CCache Yapılandırması
Varsayılan ayarlarla çalışan ccache çoğu zaman yeterlidir ancak daha iyi performans için yapılandırma yapılabilir. Ayarlar genellikle ~/.ccache/config dosyasında saklanır. Örnek yapılandırma:
Makefile Dosyalarında Gerekli Değişiklikler
Metin2 gibi projelerde Makefile dosyaları genellikle gcc veya clang ile derlenir. Ccache kullanabilmek için Makefile dosyasındaki derleyici komutları ccache üzerinden yönlendirilmelidir. Örneğin:
ya da clang kullanıyorsanız:
Bu şekilde tüm derleme işlemleri artık ccache üzerinden yönlendirilecek ve daha hızlı olacaktır.
CCache Kullanımı ile İlgili İpuçları
- ccache -s komutu ile önbellek durumu kontrol edilebilir.
- ccache -C komutu ile önbellek temizlenebilir.
- Proje yapısı değişirse, eski önbellek verileri sorun çıkarabilir; bu durumda önbelleği temizlemek iyi olur.
Metin2 Sunucu Derlemelerinde CCache Kullanımı
Metin2 FreeBSD sunucularında özellikle src klasöründeki kaynak kodların tekrar tekrar derlenmesi gerekebilir. Bu gibi durumlarda ccache kullanmak, geliştirme ve test süreçlerini hızlandırır. Özellikle jail veya chroot ortamlarında çalışan FreeBSD sistemlerinde ccache, aynı derleme işlemlerinin birden fazla kez yapılması durumunda büyük avantaj sağlar.
Sonuç
FreeBSD üzerinde Metin2 gibi projeleri derlerken ccache kullanmak, derleme süresini ciddi anlamda azaltarak verimliliği artırır. Doğru yapılandırılmış bir ccache sistemi, hem geliştirme hem de üretim ortamlarında büyük kolaylık sağlar. Makefile düzenlemeleriyle entegrasyonu oldukça basittir ve ccache'nin sunduğu hız avantajı, özellikle büyük projelerde çok belirgindir.
Fast Compilation with CCache on FreeBSD: Installation and Makefile Modifications
Using ccache can significantly save time while compiling large projects like Metin2 servers on FreeBSD systems. This article details the installation, configuration of ccache on FreeBSD, and necessary modifications to Makefile files.
What is CCache?
Ccache (C/C++ compiler cache) is a tool that speeds up compilation processes by caching outputs from previous compilations and reusing them when the same code is compiled again. In systems like Metin2, where source codes are frequently recompiled during development, ccache can provide significant time savings.
Installing CCache on FreeBSD
On FreeBSD, ccache can be easily installed either via ports or pkg system. Execute the following command with root privileges:
Alternatively, if you prefer the ports system:
After installation, you should be able to call ccache directly from your terminal.
Configuring CCache
While ccache works fine with default settings, better performance can be achieved through configuration. Settings are typically stored in the ~/.ccache/config file. Sample configuration:
Making Necessary Changes in Makefile
In projects like Metin2, Makefiles usually compile with gcc or clang. To use ccache, compiler commands in the Makefile must be directed through ccache. For example:
Or if you are using clang:
With this setup, all compilation processes will now go through ccache, making them faster.
Tips for Using CCache
- Use ccache -s to check cache status.
- Use ccache -C to clear the cache.
- If project structure changes, old cached data may cause issues; clearing the cache is recommended in such cases.
Using CCache in Metin2 Server Compilations
When compiling source codes in Metin2 FreeBSD servers, especially within the src folder, repeated builds might be required. In such cases, using ccache accelerates development and testing processes. Especially in FreeBSD systems running in jail or chroot environments, ccache provides significant advantages when the same compilation tasks are performed multiple times.
Conclusion
Using ccache while compiling projects like Metin2 on FreeBSD significantly reduces build times and improves efficiency. A properly configured ccache system offers great convenience in both development and production environments. Integration through Makefile modifications is straightforward, and the speed advantage offered by ccache becomes highly noticeable in large projects.
CCache ile derleme işlemini birçok kişi biliyor fakat nasıl kullanılacağına dair bir anlatım yok. Bu derleme metodu ccache kurduktan ilk dosyalarınızı normal sürede derlersiniz ve ccache derlediğiniz dosyaları önbelleğe kopyalar bu sayede diğer derlemelerinizi yaparken build süresi 10 dakika ise bu şekilde 1 dakikaya düşer.
CCache'de temizleme komutlarıda var bunlar;
Kod:
ccache --cleanup ccache --clean[/FONT]
Kurulum;
İşlem çok basit. Derleme yaptığınız sunucuya bağlanıyorsunu ve şu komutu giriyorsunuz;
Kod:
pkg install ccache
Kurulumu yaptıktan sonra makefile dosyalarınızda düzenleme yapmamız gerekiyor. Makefile dosyalarınızca gcc sürümünüzü yazdığınız kısımın başına ccache ekliyoruz ve bu kadar başka bir işlem gerekmiyor. Bu işlemi tüm dosyalarınızdaki makefile dosyalarına eklemeniz gerekiyor örnek bir dosya görüntüsü;
Bu işlemi tüm dosyalarda yaptıktan sonra tek farklı işlem liblua klasöründe. Liblua klasöründeki config dosyası içine yazmanız gerekiyor ccache eklemesini o da şu şekilde;
FreeBSD'de CCache ile Hızlı Derleme: Kurulum ve Makefile Düzenlemeleri
FreeBSD sistemler üzerinde Metin2 sunucuları gibi büyük projeleri derlerken zaman kazanmak için ccache kullanımı oldukça faydalıdır. Bu makalede, FreeBSD ortamında ccache kurulumu, yapılandırması ve Makefile dosyalarında gerekli düzenlemeler nasıl yapılır detaylıca ele alınacaktır.
CCache Nedir?
Ccache (C/C++ compiler cache), derleme süreçlerinde aynı kod tekrar derleniyorsa, daha önce yapılan derleme çıktısını önbellekte tutarak tekrar derlemek yerine bu çıktıyı kullanarak hız kazandıran bir araçtır. Özellikle Metin2 gibi sürekli geliştirilen, kaynak kodları sık sık yeniden derlenen sistemlerde ccache sayesinde önemli zaman tasarrufu sağlanabilir.
FreeBSD Üzerine CCache Kurulumu
FreeBSD üzerinde ccache, hem ports hem de pkg sistemi ile kolayca kurulabilir. Tercihen root yetkisiyle aşağıdaki komutu çalıştırarak ccache'i yükleyin:
Kod:
pkg install ccache
Alternatif olarak ports sistemini kullanmak isterseniz:
Kod:
cd /usr/ports/devel/ccache && make install clean
Yükleme tamamlandıktan sonra ccache komutunu doğrudan terminalden çağırabilmelisiniz.
CCache Yapılandırması
Varsayılan ayarlarla çalışan ccache çoğu zaman yeterlidir ancak daha iyi performans için yapılandırma yapılabilir. Ayarlar genellikle ~/.ccache/config dosyasında saklanır. Örnek yapılandırma:
Kod:
max_size = 10G[BR][/BR]hash_dir = true[BR][/BR]base_dir = /home/user/project
Makefile Dosyalarında Gerekli Değişiklikler
Metin2 gibi projelerde Makefile dosyaları genellikle gcc veya clang ile derlenir. Ccache kullanabilmek için Makefile dosyasındaki derleyici komutları ccache üzerinden yönlendirilmelidir. Örneğin:
Kod:
CC = ccache gcc[BR][/BR]CXX = ccache g++
ya da clang kullanıyorsanız:
Kod:
CC = ccache clang[BR][/BR]CXX = ccache clang++
Bu şekilde tüm derleme işlemleri artık ccache üzerinden yönlendirilecek ve daha hızlı olacaktır.
CCache Kullanımı ile İlgili İpuçları
- ccache -s komutu ile önbellek durumu kontrol edilebilir.
- ccache -C komutu ile önbellek temizlenebilir.
- Proje yapısı değişirse, eski önbellek verileri sorun çıkarabilir; bu durumda önbelleği temizlemek iyi olur.
Metin2 Sunucu Derlemelerinde CCache Kullanımı
Metin2 FreeBSD sunucularında özellikle src klasöründeki kaynak kodların tekrar tekrar derlenmesi gerekebilir. Bu gibi durumlarda ccache kullanmak, geliştirme ve test süreçlerini hızlandırır. Özellikle jail veya chroot ortamlarında çalışan FreeBSD sistemlerinde ccache, aynı derleme işlemlerinin birden fazla kez yapılması durumunda büyük avantaj sağlar.
Sonuç
FreeBSD üzerinde Metin2 gibi projeleri derlerken ccache kullanmak, derleme süresini ciddi anlamda azaltarak verimliliği artırır. Doğru yapılandırılmış bir ccache sistemi, hem geliştirme hem de üretim ortamlarında büyük kolaylık sağlar. Makefile düzenlemeleriyle entegrasyonu oldukça basittir ve ccache'nin sunduğu hız avantajı, özellikle büyük projelerde çok belirgindir.
Fast Compilation with CCache on FreeBSD: Installation and Makefile Modifications
Using ccache can significantly save time while compiling large projects like Metin2 servers on FreeBSD systems. This article details the installation, configuration of ccache on FreeBSD, and necessary modifications to Makefile files.
What is CCache?
Ccache (C/C++ compiler cache) is a tool that speeds up compilation processes by caching outputs from previous compilations and reusing them when the same code is compiled again. In systems like Metin2, where source codes are frequently recompiled during development, ccache can provide significant time savings.
Installing CCache on FreeBSD
On FreeBSD, ccache can be easily installed either via ports or pkg system. Execute the following command with root privileges:
Kod:
pkg install ccache
Alternatively, if you prefer the ports system:
Kod:
cd /usr/ports/devel/ccache && make install clean
After installation, you should be able to call ccache directly from your terminal.
Configuring CCache
While ccache works fine with default settings, better performance can be achieved through configuration. Settings are typically stored in the ~/.ccache/config file. Sample configuration:
Kod:
max_size = 10G[BR][/BR]hash_dir = true[BR][/BR]base_dir = /home/user/project
Making Necessary Changes in Makefile
In projects like Metin2, Makefiles usually compile with gcc or clang. To use ccache, compiler commands in the Makefile must be directed through ccache. For example:
Kod:
CC = ccache gcc[BR][/BR]CXX = ccache g++
Or if you are using clang:
Kod:
CC = ccache clang[BR][/BR]CXX = ccache clang++
With this setup, all compilation processes will now go through ccache, making them faster.
Tips for Using CCache
- Use ccache -s to check cache status.
- Use ccache -C to clear the cache.
- If project structure changes, old cached data may cause issues; clearing the cache is recommended in such cases.
Using CCache in Metin2 Server Compilations
When compiling source codes in Metin2 FreeBSD servers, especially within the src folder, repeated builds might be required. In such cases, using ccache accelerates development and testing processes. Especially in FreeBSD systems running in jail or chroot environments, ccache provides significant advantages when the same compilation tasks are performed multiple times.
Conclusion
Using ccache while compiling projects like Metin2 on FreeBSD significantly reduces build times and improves efficiency. A properly configured ccache system offers great convenience in both development and production environments. Integration through Makefile modifications is straightforward, and the speed advantage offered by ccache becomes highly noticeable in large projects.
