Skip to content

Commit

Permalink
Here we go
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan4ibanez committed Sep 15, 2024
0 parents commit 95481d5
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"fortran.linter.compiler": "gfortran",
"fortran.linter.includePaths": [
"${workspaceFolder}/build/**"
],
"fortran.fortls.directories": [
"${workspaceFolder}/build/**"
],
"fortran.formatting.formatter": "findent",
"fortran.formatting.findentArgs": [
"-i2"
],
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|!|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)",
// We don't want to see the mod files or the build directory because it clutters everything up.
"files.exclude": {
"**/.git": true,
"**/**.mod": true,
"build/": true,
"scripts/": true
},
}
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 jordan4ibanez

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
default:
@fpm run


windows:
@fpm run --c-flag -Wno-discarded-qualifiers --c-flag -Wno-incompatible-pointer-types


gdb:
@MALLOC_CHECK_=2 fpm run --flag -g --flag -lmcheck \
--c-flag -g --c-flag -lmcheck

valgrind:
@./scripts/create_version_info.sh
@valgrind --trace-children=yes --leak-check=full fpm run --flag -g \
--c-flag -g


release:
@fpm run --flag -fuse-ld=mold --flag -O3 --flag -march=native --flag -mtune=native --flag -g \
--c-flag -fuse-ld=mold --c-flag -O3 --c-flag -march=native --c-flag -mtune=native --c-flag -g


mac-release:
@fpm run --flag -O3 --flag -march=native --flag -mtune=native --flag -g \
--c-flag -O3 --c-flag -march=native --c-flag -mtune=native --c-flag -g


.PHONY: test
test:
@fpm test


.PHONY: test_gdb
test_gdb:
@MALLOC_CHECK_=2 fpm test --flag -g --flag -lmcheck \
--c-flag -g --c-flag -lmcheck


.PHONY: test_valgrind
test_valgrind:
@valgrind --trace-children=yes --leak-check=full fpm test --flag -g \
--c-flag -g


#! CLEANING COMMANDS.

# Use this if the vscode extension gives up.
clean:
@./scripts/clear_mod_files.sh
@./scripts/remove_build_folder.sh

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# hashmap_f90
My cool new project!
20 changes: 20 additions & 0 deletions fpm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name = "hashmap_f90"
version = "0.1.0"
license = "license"
author = "jordan4ibanez"
maintainer = "jordan4ibanez"
copyright = "Copyright 2024, jordan4ibanez"

[build]
auto-executables = true
auto-tests = true
auto-examples = true
module-naming = false

[install]
library = false

[fortran]
implicit-typing = false
implicit-external = false
source-form = "free"
5 changes: 5 additions & 0 deletions scripts/clear_mod_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# The laziest script known to man.
# https://askubuntu.com/a/377442
find . -name "*.mod" -type f -delete
2 changes: 2 additions & 0 deletions scripts/remove_build_folder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
rm -rf ./build/
10 changes: 10 additions & 0 deletions src/hashmap_f90.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module hashmap_f90
implicit none
private

public :: say_hello
contains
subroutine say_hello
print *, "Hello, hashmap_f90!"
end subroutine say_hello
end module hashmap_f90

0 comments on commit 95481d5

Please sign in to comment.