Skip to content

Addition of a prefix to the names of the libraries#1102

Merged
jvdp1 merged 3 commits into
fortran-lang:masterfrom
jvdp1:fix_prefix
Jan 25, 2026
Merged

Addition of a prefix to the names of the libraries#1102
jvdp1 merged 3 commits into
fortran-lang:masterfrom
jvdp1:fix_prefix

Conversation

@jvdp1

@jvdp1 jvdp1 commented Jan 24, 2026

Copy link
Copy Markdown
Member

Addition of the prefix fortran_stdlib_ to the names of all libraries.

The prefix fortran_stdlib_ is required to avoid conflicts when fortran-stdlib is installed via package managers.

Fixes #1101

@jvdp1
jvdp1 requested a review from Copilot January 24, 2026 14:56
@jvdp1

jvdp1 commented Jan 24, 2026

Copy link
Copy Markdown
Member Author

@zoziha would such an approach solve your issue?

Each library starts now with libfortran_stdblib_.

@jvdp1
jvdp1 requested review from jalvesz, perazz and zoziha January 24, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@codecov

codecov Bot commented Jan 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.53%. Comparing base (650e915) to head (a106c59).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1102   +/-   ##
=======================================
  Coverage   68.53%   68.53%           
=======================================
  Files         396      396           
  Lines       12746    12746           
  Branches     1376     1376           
=======================================
  Hits         8736     8736           
  Misses       4010     4010           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zoziha zoziha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this addition, @jvdp1 .

And I submitted a sub-PR to fix the issue of duplicate exported library names in the fortran_stdlib.pc file.

@jvdp1

jvdp1 commented Jan 25, 2026

Copy link
Copy Markdown
Member Author

Thanks for this addition, @jvdp1 .

And I submitted a sub-PR to fix the issue of duplicate exported library names in the fortran_stdlib.pc file.

Thank you @zoziha . Unfortunately your proposed changes breaks the dependency order of the libraries. Based on your comment, I commited the following changes: a106c59 . could you check that it solves your issue re: duplicates, please?

@jvdp1

jvdp1 commented Jan 25, 2026

Copy link
Copy Markdown
Member Author

Thanks for this addition, @jvdp1 .
And I submitted a sub-PR to fix the issue of duplicate exported library names in the fortran_stdlib.pc file.

Thank you @zoziha . Unfortunately your proposed changes breaks the dependency order of the libraries. Based on your comment, I commited the following changes: a106c59 . could you check that it solves your issue re: duplicates, please?

Here is the Makefile used to test the order of the libraries provided by pkg-config after the installation of stdlib (it should be placed inside example and the variable install_dir should be adapted):

# Necessary if the installation directory is not in PKG_CONFIG_PATH
install_dir :=$(CURDIR)/../../stdlib_make1

export PKG_CONFIG_PATH := $(install_dir)/lib/pkgconfig:$(PKG_CONFIG_PATH)

STDLIB_CFLAGS := `pkg-config --cflags fortran_stdlib`
STDLIB_LIBS := `pkg-config --libs fortran_stdlib`

# Example definition of Fortran compiler and flags
FC := gfortran
FFLAGS := -O2 -g

# Definition of targets etc.
PROG=ansi/example_ansi_color \
ansi/example_ansi_combine \
ansi/example_ansi_concat \
ansi/example_ansi_to_string \
array/example_falseloc \
array/example_trueloc \
ascii/example_ascii_reverse \
ascii/example_ascii_to_lower \
ascii/example_ascii_to_sentence \
ascii/example_ascii_to_title \
ascii/example_ascii_to_upper \
bitsets/example_bitsets_all \
bitsets/example_bitsets_and \
bitsets/example_bitsets_and_not \
bitsets/example_bitsets_any \
bitsets/example_bitsets_assignment \
bitsets/example_bitsets_bit_count \
bitsets/example_bitsets_bits \
bitsets/example_bitsets_clear \
bitsets/example_bitsets_equality \
bitsets/example_bitsets_extract \
bitsets/example_bitsets_flip \
bitsets/example_bitsets_from_string \
bitsets/example_bitsets_ge \
bitsets/example_bitsets_gt \
bitsets/example_bitsets_inequality \
bitsets/example_bitsets_init \
bitsets/example_bitsets_input \
bitsets/example_bitsets_le \
bitsets/example_bitsets_lt \
bitsets/example_bitsets_none \
bitsets/example_bitsets_not \
bitsets/example_bitsets_or \
bitsets/example_bitsets_output \
bitsets/example_bitsets_read_bitset \
bitsets/example_bitsets_set \
bitsets/example_bitsets_test \
bitsets/example_bitsets_to_string \
bitsets/example_bitsets_value \
bitsets/example_bitsets_write_bitset \
bitsets/example_bitsets_xor \
constants/example_constants \
error/example_check1 \
error/example_check2 \
error/example_check3 \
error/example_check4 \
error/example_error_state1 \
error/example_error_state2 \
error/example_error_stop1 \
error/example_error_stop2 \
hashmaps/example_hashmaps_calls \
hashmaps/example_hashmaps_copy_key \
hashmaps/example_hashmaps_entries \
hashmaps/example_hashmaps_equal_keys \
hashmaps/example_hashmaps_fnv_1a_hasher \
hashmaps/example_hashmaps_fnv_1_hasher \
hashmaps/example_hashmaps_free_key \
hashmaps/example_hashmaps_get_all_keys \
hashmaps/example_hashmaps_get \
hashmaps/example_hashmaps_get_other_data \
hashmaps/example_hashmaps_hasher_fun \
hashmaps/example_hashmaps_init \
hashmaps/example_hashmaps_key_test \
hashmaps/example_hashmaps_loading \
hashmaps/example_hashmaps_map_entry \
hashmaps/example_hashmaps_num_slots \
hashmaps/example_hashmaps_probes \
hashmaps/example_hashmaps_rehash \
hashmaps/example_hashmaps_remove \
hashmaps/example_hashmaps_seeded_nmhash32_hasher \
hashmaps/example_hashmaps_seeded_nmhash32x_hasher \
hashmaps/example_hashmaps_seeded_water_hasher \
hashmaps/example_hashmaps_set \
hashmaps/example_hashmaps_set_other_data \
hashmaps/example_hashmaps_slots_bits \
hashmaps/example_hashmaps_total_depth \
hash_procedures/example_fibonacci_hash_64 \
hash_procedures/example_fibonacci_hash \
hash_procedures/example_fnv_1a_hash_64 \
hash_procedures/example_fnv_1a_hash \
hash_procedures/example_fnv_1_hash_64 \
hash_procedures/example_fnv_1_hash \
hash_procedures/example_nmhash32 \
hash_procedures/example_nmhash32x \
hash_procedures/example_pengy_hash \
hash_procedures/example_spooky_hash \
hash_procedures/example_universal_mult_hash_64 \
hash_procedures/example_universal_mult_hash \
hash_procedures/example_water_hash \
intrinsics/example_dot_product \
intrinsics/example_matmul \
intrinsics/example_sum \
io/example_fmt_constants \
io/example_get_file \
io/example_get_line \
io/example_loadnpy \
io/example_loadtxt \
io/example_open \
io/example_savenpy \
io/example_savetxt \
linalg/example_blas_gemv \
linalg/example_cholesky \
linalg/example_chol \
linalg/example_constrained_lstsq1 \
linalg/example_constrained_lstsq2 \
linalg/example_cross_product \
linalg/example_determinant2 \
linalg/example_determinant \
linalg/example_diag1 \
linalg/example_diag2 \
linalg/example_diag3 \
linalg/example_diag4 \
linalg/example_diag5 \
linalg/example_eig \
linalg/example_eig_generalized \
linalg/example_eigh \
linalg/example_eigvals \
linalg/example_eigvals_generalized \
linalg/example_eigvalsh \
linalg/example_expm \
linalg/example_eye1 \
linalg/example_eye2 \
linalg/example_get_norm \
linalg/example_hermitian \
linalg/example_inverse_function \
linalg/example_inverse_inplace \
linalg/example_inverse_operator \
linalg/example_inverse_subroutine \
linalg/example_is_diagonal \
linalg/example_is_hermitian \
linalg/example_is_hessenberg \
linalg/example_is_skew_symmetric \
linalg/example_is_square \
linalg/example_is_symmetric \
linalg/example_is_triangular \
linalg/example_kronecker_product \
linalg/example_lapack_getrf \
linalg/example_lstsq1 \
linalg/example_lstsq2 \
linalg/example_matrix_exp \
linalg/example_mnorm \
linalg/example_norm \
linalg/example_outer_product \
linalg/example_pivoting_qr \
linalg/example_pivoting_qr_space \
linalg/example_pseudoinverse \
linalg/example_qr \
linalg/example_qr_space \
linalg/example_schur_complex \
linalg/example_schur_eigvals \
linalg/example_schur_real \
linalg/example_solve1 \
linalg/example_solve2 \
linalg/example_solve3 \
linalg/example_solve_bicgstab \
linalg/example_solve_bicgstab_wilkinson \
linalg/example_solve_cg \
linalg/example_solve_custom \
linalg/example_solve_pcg \
linalg/example_sparse_data_accessors \
linalg/example_sparse_from_ijv \
linalg/example_sparse_spmv \
linalg/example_state1 \
linalg/example_state2 \
linalg/example_svd \
linalg/example_svdvals \
linalg/example_trace \
logger/example_add_log_unit \
logger/example_configure \
logger/example_global_logger \
logger/example_log_io_error \
logger/example_log_text_error \
math/example_clip_integer \
math/example_clip_real \
math/example_diff \
math/example_gcd \
math/example_linspace_complex \
math/example_linspace_int16 \
math/example_logspace_complex \
math/example_logspace_int \
math/example_logspace_rstart_cbase \
math/example_math_all_close \
math/example_math_arange \
math/example_math_argd \
math/example_math_arg \
math/example_math_argpi \
math/example_math_deg2rad \
math/example_math_is_close \
math/example_math_rad2deg \
math/example_meshgrid \
optval/example_optval \
quadrature/example_gauss_legendre \
quadrature/example_gauss_legendre_lobatto \
quadrature/example_simps \
quadrature/example_simps_weights \
quadrature/example_trapz \
quadrature/example_trapz_weights \
random/example_dist_rand \
random/example_random_seed \
selection/example_arg_select \
selection/example_select \
selection/selection_vs_sort \
sorting/example_ord_sort \
sorting/example_radix_sort \
sorting/example_sort_adjoint \
sorting/example_sort_bitset \
sorting/example_sort \
sorting/example_sort_index \
specialfunctions_activations/example_elu \
specialfunctions_activations/example_gaussian \
specialfunctions_activations/example_gelu \
specialfunctions_activations/example_leaky_relu \
specialfunctions_activations/example_logsoftmax \
specialfunctions_activations/example_relu \
specialfunctions_activations/example_selu \
specialfunctions_activations/example_silu \
specialfunctions_activations/example_softmax \
specialfunctions_activations/example_softplus \
specialfunctions_activations/example_step \
specialfunctions_gamma/example_gamma \
specialfunctions_gamma/example_gamma_p \
specialfunctions_gamma/example_gamma_q \
specialfunctions_gamma/example_ligamma \
specialfunctions_gamma/example_log_factorial \
specialfunctions_gamma/example_log_gamma \
specialfunctions_gamma/example_uigamma \
specialmatrices/example_specialmatrices_cdp_spmv \
specialmatrices/example_specialmatrices_dp_spmv \
specialmatrices/example_tridiagonal_dp_type \
stats_distribution_exponential/example_exponential_cdf \
stats_distribution_exponential/example_exponential_pdf \
stats_distribution_exponential/example_exponential_rvs \
stats_distribution_normal/example_normal_cdf \
stats_distribution_normal/example_normal_pdf \
stats_distribution_normal/example_normal_rvs \
stats_distribution_uniform/example_shuffle \
stats_distribution_uniform/example_uniform_cdf \
stats_distribution_uniform/example_uniform_pdf \
stats_distribution_uniform/example_uniform_rvs \
stats/example_corr \
stats/example_cov \
stats/example_mean \
stats/example_median \
stats/example_moment \
stats/example_var \
stringlist_type/example_stringlist_type_clear \
stringlist_type/example_stringlist_type_concatenate_operator \
stringlist_type/example_stringlist_type_constructor \
stringlist_type/example_stringlist_type_equality_operator \
stringlist_type/example_stringlist_type_fidx_bidx \
stringlist_type/example_stringlist_type_get \
stringlist_type/example_stringlist_type_inequality_operator \
stringlist_type/example_stringlist_type_insert_at \
stringlist_type/example_stringlist_type_len \
strings/example_chomp \
strings/example_count \
strings/example_ends_with \
strings/example_find \
strings/example_join \
strings/example_padl \
strings/example_padr \
strings/example_replace_all \
strings/example_slice \
strings/example_starts_with \
strings/example_stream_of_strings_to_numbers \
strings/example_string_to_number \
strings/example_strip \
strings/example_to_c_char \
strings/example_to_string \
strings/example_zfill \
string_type/example_adjustl \
string_type/example_adjustr \
string_type/example_char \
string_type/example_char_position \
string_type/example_char_range \
string_type/example_constructor_character \
string_type/example_constructor_empty \
string_type/example_constructor_integer \
string_type/example_constructor_logical \
string_type/example_constructor_scalar \
string_type/example_cont \
string_type/example_eq \
string_type/example_fread \
string_type/example_fwrite \
string_type/example_ge \
string_type/example_gt \
string_type/example_iachar \
string_type/example_ichar \
string_type/example_index \
string_type/example_le \
string_type/example_len \
string_type/example_len_trim \
string_type/example_lge \
string_type/example_lgt \
string_type/example_lle \
string_type/example_llt \
string_type/example_lt \
string_type/example_move \
string_type/example_ne \
string_type/example_repeat \
string_type/example_reverse \
string_type/example_scan \
string_type/example_to_lower \
string_type/example_to_sentence \
string_type/example_to_title \
string_type/example_to_upper \
string_type/example_trim \
string_type/example_uread \
string_type/example_uwrite \
string_type/example_verify \
system/example_cwd \
system/example_delete_file \
system/example_exists \
system/example_fs_error \
system/example_get_runtime_os \
system/example_is_directory \
system/example_is_file \
system/example_is_symlink \
system/example_make_directory \
system/example_null_device \
system/example_os_type \
system/example_path_base_name \
system/example_path_dir_name \
system/example_path_join \
system/example_path_split_path \
system/example_process_1 \
system/example_process_2 \
system/example_process_3 \
system/example_process_4 \
system/example_process_5 \
system/example_process_6 \
system/example_process_7 \
system/example_remove_directory \
system/example_sleep \
version/example_version

all: $(PROG)

# Example rule to compile object files from  .f90 files
%.o: %.f90
	$(FC) -c -o $@ $< $(FFLAGS) $(STDLIB_CFLAGS)

# Example rule to link an executable from object files
%: %.o
	$(FC) -o $@ $^ $(FFLAGS) $(STDLIB_LIBS)

clean:
	$(RM) $(PROG)

@fortran-lang/stdlib It might be a good idea to add such a Makefile in a CI workflow for testing pkg-config. The modularization of stdlib leads to a quite complex order of the libraries.

@zoziha

zoziha commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Thanks for this addition, @jvdp1 .
And I submitted a sub-PR to fix the issue of duplicate exported library names in the fortran_stdlib.pc file.

Thank you @zoziha . Unfortunately your proposed changes breaks the dependency order of the libraries. Based on your comment, I commited the following changes: a106c59 . could you check that it solves your issue re: duplicates, please?

Yes, the duplicate library names are resolved correctly with your commits. LGTM, if there are no new comments, this PR can be merged at any time. Thank you, @jvdp1.

New fortran_stdlib.pc:

prefix=/ucrt64
libdir=${prefix}/lib
includedir=${prefix}/include
moduledir=${prefix}/include/fortran_stdlib/GNU-14.2.0

Name: fortran_stdlib
Description: Community driven and agreed upon de facto standard library for Fortran
Version: 0.8.0
Libs: -L${libdir} -lfortran_stdlib -lfortran_stdlib_stats -lfortran_stdlib_hashmaps
-lfortran_stdlib_ansi -lfortran_stdlib_system -lfortran_stdlib_stringlist
-lfortran_stdlib_specialmatrices -lfortran_stdlib_selection
-lfortran_stdlib_quadrature -lfortran_stdlib_specialfunctions -lfortran_stdlib_math
-lfortran_stdlib_logger -lfortran_stdlib_linalg_iterative -lfortran_stdlib_sparse
-lfortran_stdlib_linalg -lfortran_stdlib_sorting -lfortran_stdlib_bitsets
-lfortran_stdlib_lapack_extended -lfortran_stdlib_lapack -lfortran_stdlib_io
-lfortran_stdlib_strings -lfortran_stdlib_intrinsics -lfortran_stdlib_blas /path/to/libopenblas.dll.a
-lfortran_stdlib_linalg_core -lfortran_stdlib_hash
-lfortran_stdlib_constants -lfortran_stdlib_core -lfortran_stdlib_array
Cflags: -I${includedir} -I${moduledir}

@jvdp1

jvdp1 commented Jan 25, 2026

Copy link
Copy Markdown
Member Author

Yes, the duplicate library names are resolved correctly with your commits. LGTM, if there are no new comments, this PR can be merged at any time. Thank you, @jvdp1.

Thank you @zoziha for testing it.
Should we generate a new release (e.g. v0.8.1) such that you are able to package it for MSYS2?

@zoziha

zoziha commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Should we generate a new release (e.g. v0.8.1) such that you are able to package it for MSYS2?

Yes, this will do me a favour, so that I can easily package the latest fortran_stdlib for MSYS2. Alternatively, I might need to set up a git patch file for the fortran_stdlib package of MSYS2 based on the fortran_stdlib-v0.8.0 tarball and this PR. Both are acceptable.

@jalvesz

jalvesz commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

LGTM @jvdp1, I have one question regarding your proposal to include the makefile in the CI. That seems fragile as it might imply tracking manually changes in all modules. Is any way that the makefile or at least the list can be generated in a automatic manner?

Agree for a 0.8.1

@jvdp1

jvdp1 commented Jan 25, 2026

Copy link
Copy Markdown
Member Author

I have one question regarding your proposal to include the makefile in the CI. That seems fragile as it might imply tracking manually changes in all modules. Is any way that the makefile or at least the list can be generated in a automatic manner?

I agree with you @jalvesz that the Makefile I pasted above is highly-error prone, and we should not use it in a CI workflow. Actually we don't need a makefile for testing the order generated by pkg-config. The following should be enough if applied to all example f90 files:

gfortran -O2 -g `pkg-config --cflags fortran_stdlib` ascii/example_ascii_to_lower.f90 `pkg-config --libs fortran_stdlib`

I'll think about a more general cross-platform approach

@jvdp1
jvdp1 merged commit de3e59f into fortran-lang:master Jan 25, 2026
41 checks passed
@jvdp1
jvdp1 deleted the fix_prefix branch February 13, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal/Discussion: Enhancing Library Naming Conventions for the Modularized Build

4 participants