Skip to content

Update build configuration and .gitignore for clean builds#26

Open
SimPleased wants to merge 1 commit into
MinecraftAtHome:mainfrom
SimPleased:refactor-build-system
Open

Update build configuration and .gitignore for clean builds#26
SimPleased wants to merge 1 commit into
MinecraftAtHome:mainfrom
SimPleased:refactor-build-system

Conversation

@SimPleased

Copy link
Copy Markdown

The makefile now will:
Compile all files using all threads rather than only using one thread.
Build files will exist in ./build with the object files being in ./build/obj.

The gitignore was modified as it no longed needed to ignore *.a, *.o, main, main.exe as they all now exist within the ./build dir.

Comment thread .gitignore
*.o
*.a
main
main.exe

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.

Why does removing these make it any cleaner?
This just allows the potential for people to add binaries to their fork of the repo.

Comment thread makefile

$(info Using ARCH = $(ARCH))
override CFLAGS += -O3

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.

Don't need this format change

Comment thread makefile
UNBOUND ?= 0
PRINT_INTERVAL ?= 256


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.

Don't need this format change

Comment thread makefile
override CXXFLAGS += -O3 -std=c++20 -I asio/asio/include -DOMISSION_LARGE_BIOMES=$(LARGE_BIOMES) -DOMISSION_UNBOUND=$(UNBOUND) -DPRINT_INTERVAL=$(PRINT_INTERVAL)
override NVCC_FLAGS += $(CXXFLAGS) --expt-relaxed-constexpr --default-stream per-thread -arch=$(ARCH) -use_fast_math
override NVCC_FLAGS += $(CXXFLAGS) --expt-relaxed-constexpr --default-stream per-thread -arch=$(ARCH) -use_fast_math

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.

Same as above with the format changes

Comment thread makefile

# nvcc src/*.cpp src/*.c src/*.cu -o main.exe cubiomes/biomenoise.c cubiomes/biomes.c cubiomes/finders.c cubiomes/generator.c cubiomes/layers.c cubiomes/noise.c -arch=native -O3 -std=c++20 -I asio-1.34.2/include -DOMISSION_LARGE_BIOMES=1 --expt-relaxed-constexpr --default-stream per-thread -D_WIN32_WINNT=0x0601
main.exe: $(SRC) $(CUBIOMES_SRC)
ifeq ($(OS),Windows_NT)

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.

What's the point in moving all the build stuff for windows out of the previous windows block if you're just gonna make a new windows block to put those things in instead?

Comment thread makefile

cubiomes.o: src/cubiomes.c src/cubiomes.h
$(CC) -c $< -o $@ $(CFLAGS)
$(OBJ_DIR)/cubiomes.o: src/cubiomes.c src/cubiomes.h

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.

None of these compile options will work on windows since they're under the else of your new conditional block.

Comment thread makefile
# Override manually with: make ARCH=sm_89
ifndef ARCH
GPU_NAMES := $(shell nvidia-smi --query-gpu=name --format=csv,noheader)
GPU_NAMES := $(shell nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null)

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.

I don't think /dev/null is a thing on windows.

Comment thread makefile
$(info Using ARCH = $(ARCH))
override CFLAGS += -O3

override CFLAGS += -O3 -fwrapv

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.

Does this do anything outside of cubiomes? We previously only applied it to cubiomes.

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.

2 participants