Skip to content

Commit

Permalink
Rename lfortran_runtime to lpython_runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirumalai-Shaktivel committed Mar 27, 2022
1 parent 567e966 commit 770e26e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions ci/build.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ jupyter kernelspec list --json

cp lpython-$lpython_version/test-bld/src/bin/lpython src/bin
if $WIN == "1":
cp lpython-$lpython_version/test-bld/src/runtime/lfortran_runtime* src/runtime/
cp lpython-$lpython_version/test-bld/src/runtime/lpython_runtime* src/runtime/
else:
cp lpython-$lpython_version/test-bld/src/runtime/liblfortran_runtime* src/runtime/
cp lpython-$lpython_version/test-bld/src/runtime/liblpython_runtime* src/runtime/
14 changes: 7 additions & 7 deletions src/bin/lpython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,24 +294,24 @@ int link_executable(const std::vector<std::string> &infiles,
The `gcc` line for dynamic linking that is constructed below:
gcc -o $outfile $infile \
-Lsrc/runtime -Wl,-rpath=src/runtime -llfortran_runtime
-Lsrc/runtime -Wl,-rpath=src/runtime -llpython_runtime
is equivalent to the following:
ld -o $outfile $infile \
-Lsrc/runtime -rpath=src/runtime -llfortran_runtime \
-Lsrc/runtime -rpath=src/runtime -llpython_runtime \
-dynamic-linker /lib64/ld-linux-x86-64.so.2 \
/usr/lib/x86_64-linux-gnu/Scrt1.o /usr/lib/x86_64-linux-gnu/libc.so
and this for static linking:
gcc -static -o $outfile $infile \
-Lsrc/runtime -Wl,-rpath=src/runtime -llfortran_runtime_static
-Lsrc/runtime -Wl,-rpath=src/runtime -llpython_runtime_static
is equivalent to:
ld -o $outfile $infile \
-Lsrc/runtime -rpath=src/runtime -llfortran_runtime_static \
-Lsrc/runtime -rpath=src/runtime -llpython_runtime_static \
/usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o \
/usr/lib/x86_64-linux-gnu/libc.a \
/usr/lib/gcc/x86_64-linux-gnu/7/libgcc_eh.a \
Expand Down Expand Up @@ -357,7 +357,7 @@ int link_executable(const std::vector<std::string> &infiles,
for (auto &s : infiles) {
cmd += s + " ";
}
cmd += runtime_library_dir + "\\lfortran_runtime_static.lib";
cmd += runtime_library_dir + "\\lpython_runtime_static.lib";
int err = system(cmd.c_str());
if (err) {
std::cout << "The command '" + cmd + "' failed." << std::endl;
Expand All @@ -369,13 +369,13 @@ int link_executable(const std::vector<std::string> &infiles,
if (env_CC) CC = env_CC;
std::string base_path = "\"" + runtime_library_dir + "\"";
std::string options;
std::string runtime_lib = "lfortran_runtime";
std::string runtime_lib = "lpython_runtime";
if (static_executable) {
if (compiler_options.platform != LFortran::Platform::macOS_Intel
&& compiler_options.platform != LFortran::Platform::macOS_ARM) {
options += " -static ";
}
runtime_lib = "lfortran_runtime_static";
runtime_lib = "lpython_runtime_static";
}
std::string cmd = CC + options + " -o " + outfile + " ";
for (auto &s : infiles) {
Expand Down
2 changes: 1 addition & 1 deletion src/lpython/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (WITH_XEUS)
)
endif()
add_library(lfortran_lib ${SRC})
target_link_libraries(lfortran_lib asr lfortran_runtime_static ZLIB::ZLIB)
target_link_libraries(lfortran_lib asr lpython_runtime_static ZLIB::ZLIB)
target_include_directories(lfortran_lib BEFORE PUBLIC ${lfortran_SOURCE_DIR}/src)
target_include_directories(lfortran_lib BEFORE PUBLIC ${lfortran_BINARY_DIR}/src)
if (WITH_XEUS)
Expand Down
10 changes: 5 additions & 5 deletions src/runtime/legacy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
set(SRC
../impure/lfortran_intrinsics.c
)
add_library(lfortran_runtime SHARED ${SRC})
set_target_properties(lfortran_runtime PROPERTIES
add_library(lpython_runtime SHARED ${SRC})
set_target_properties(lpython_runtime PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../$<0:>
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../$<0:>
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../$<0:>)
add_library(lfortran_runtime_static STATIC ${SRC})
set_target_properties(lfortran_runtime_static PROPERTIES
add_library(lpython_runtime_static STATIC ${SRC})
set_target_properties(lpython_runtime_static PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../$<0:>
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../$<0:>
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../$<0:>)
install(TARGETS lfortran_runtime lfortran_runtime_static
install(TARGETS lpython_runtime lpython_runtime_static
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION share/lpython/lib
LIBRARY DESTINATION share/lpython/lib
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/ltypes/ltypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ def get_rtlib_dir():
return os.path.join(current_dir, "..")
def get_crtlib_name():
if platform.system() == "Linux":
return "liblfortran_runtime.so"
return "liblpython_runtime.so"
elif platform.system() == "Darwin":
return "liblfortran_runtime.dylib"
return "liblpython_runtime.dylib"
elif platform.system() == "Windows":
return "lfortran_runtime.dll"
return "lpython_runtime.dll"
else:
raise NotImplementedError("Platform not implemented")
def get_crtlib_path():
Expand Down
8 changes: 4 additions & 4 deletions src/runtime/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(lfortran_runtime_tests C Fortran)
project(lpython_runtime_tests C Fortran)

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug
Expand Down Expand Up @@ -43,11 +43,11 @@ set(SRC
../pure/lfortran_intrinsic_ieee_arithmetic.f90
../pure/lfortran_intrinsic_iso_c_binding.f90
)
add_library(lfortran_runtime SHARED ${SRC})
add_library(lfortran_runtime_static STATIC ${SRC})
add_library(lpython_runtime SHARED ${SRC})
add_library(lpython_runtime_static STATIC ${SRC})

macro(ADDTEST name)
add_executable(${name} ${name}.f90)
target_link_libraries(${name} lfortran_runtime ${ARGN})
target_link_libraries(${name} lpython_runtime ${ARGN})
add_test(${name} ${PROJECT_BINARY_DIR}/${name})
endmacro(ADDTEST)

0 comments on commit 770e26e

Please sign in to comment.