Skip to content

Commit

Permalink
Upgrade log4cpp to 1.1.4rc3 to address ARM64 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-odintsov committed Apr 10, 2023
1 parent bb9fd91 commit 04c620c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set (FASTNETMON_VERSION_MINOR 2)
set (FASTNETMON_VERSION_PATCH 5)

set(HIREDIS_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/hiredis_0_14")
set(LOG4CPP_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/log4cpp_1_1_3")
set(LOG4CPP_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/log4cpp_1_1_4")
# set(LIBPCAP_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/pcap_1.7.4")
set(MONGO_C_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/mongo_c_driver_1_23_0")
set(CAPNP_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/capnproto_0_8_0")
Expand Down
5 changes: 3 additions & 2 deletions src/scripts/install_fastnetmon_dependencies.pl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ sub main {
'cppkafka_0_3_1',

'gobgp_3_12_0',
'log4cpp_1_1_3',
'log4cpp_1_1_4',
'gtest_1_13_0'
);

Expand Down Expand Up @@ -423,7 +423,8 @@ sub main {
'ubuntu:22.04' => 'b3f2168c6b705804155ca944a6c7850057d50652efc57c3c4194838b147176779b98d7b2bf9af72ee141805d62f7a6c1460244ce60b570dbdffc114d5e7dc899',
'ubuntu:aarch64:22.04'=> '4e9114ed4c9fde74517f04fc8b79b44854ee5fc8b51b99816ad60dccbc61a682993c4321a0df6920a40164281ba24d171f9d4972e54a9f3015d993caf7d03c47',
},
'log4cpp_1_1_3' => {
# It's actually 1_1_4rc3 but we use only minor and major numbers
'log4cpp_1_1_4' => {
'centos:7' => '5f314177ff82f9b822c76a0256a322e1b8c81575d9b3da33f45532f0942f5358c7588cf1b88a88f8ed99c433c97a3f2fbf59a949eb32a7335c5a8d3a59895a65',
'centos:8' => 'a5e2068788957b9b14042e3ea9cc1aecb4c7910bea770e270d2a21392a7569004bda74546d7025c95f937de6368b705848c151386a765c55f3fa14ef511b67d2',
'centos:9' => '052457ac03a5640e4d51e93f47b83d5990663f0629633c956466bf156fa9bf63052700d4d2c5aae44bc5022dd9b93ef65d2dd1176a675e3dd61a6e960afa58e7',
Expand Down
29 changes: 12 additions & 17 deletions src/scripts/perllib/Fastnetmon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ sub install_boost_build {
sub install_log4cpp {
my $folder_name = shift;

my $log_cpp_version_short = '1.1.3';
my $log_cpp_version_short = '1.1.4rc3';

my $log4cpp_install_path = "$library_install_folder/$folder_name";

Expand All @@ -737,7 +737,7 @@ sub install_log4cpp {
chdir $temp_folder_for_building_project;

print "Download log4cpp sources\n";
my $log4cpp_download_result = download_file($log4cpp_url, $distro_file_name, '74f0fea7931dc1bc4e5cd34a6318cd2a51322041');
my $log4cpp_download_result = download_file($log4cpp_url, $distro_file_name, 'b32e6ec981a5d75864e1097525e1f502cc242d17');

unless ($log4cpp_download_result) {
warn "Can't download log4cpp\n";
Expand All @@ -748,29 +748,24 @@ sub install_log4cpp {
exec_command("tar -xf $distro_file_name");
chdir "$temp_folder_for_building_project/log4cpp";

if ($distro_architecture eq 'aarch64') {
# TODO: unfortunately, I removed these files and we need to switch to master build: https://git.code.sf.net/p/log4cpp/codegit
# commit: 2e117d81e94ec4f9c5af42fcf76a0583a036e106
# For arm64 build we need multiple fixes
# checking build system type... config/config.guess: unable to guess system type
# configure: error: cannot guess build type; you must specify one
exec_command("curl https://raw.githubusercontent.com/pavel-odintsov/config/master/config.guess -o./config/config.guess");
exec_command("curl https://raw.githubusercontent.com/pavel-odintsov/config/master/config.sub -o./config/config.sub");
}

print "Build log4cpp\n";

# TODO: we need some more reliable way to specify options here
my $configure_result = '';

if ($configure_options) {
exec_command("$configure_options ./configure --prefix=$log4cpp_install_path");
$configure_result = exec_command("$configure_options ./configure --prefix=$log4cpp_install_path");
} else {
exec_command("./configure --prefix=$log4cpp_install_path");
}
$configure_result = exec_command("./configure --prefix=$log4cpp_install_path");
}

if (!$configure_result) {
die "Cannot configure log4cpp\n";
}

my $make_result = exec_command("$ld_library_path_for_make make $make_options install");

if (!$make_result) {
print "make for log4cpp failed\n";
die "Make for log4cpp failed\n";
}

1;
Expand Down

0 comments on commit 04c620c

Please sign in to comment.